http://www.oxeyegames.com/wiki/index.php?title=MouseButton&feed=atom&action=historyMouseButton - Revision history2024-03-28T10:33:55ZRevision history for this page on the wikiMediaWiki 1.16.0http://www.oxeyegames.com/wiki/index.php?title=MouseButton&diff=373&oldid=prevJeb: Created page with '{{EngineHook| mouseButton(x, y, button, clickCount) | This hook is called when-ever the user clicks on a mouse button or scrolls the mouse wheel. | {{MethodParam|x|An integer|The...'2010-01-29T15:13:47Z<p>Created page with '{{EngineHook| mouseButton(x, y, button, clickCount) | This hook is called when-ever the user clicks on a mouse button or scrolls the mouse wheel. | {{MethodParam|x|An integer|The...'</p>
<p><b>New page</b></p><div>{{EngineHook|<br />
mouseButton(x, y, button, clickCount)<br />
|<br />
This hook is called when-ever the user clicks on a mouse button or scrolls the mouse wheel.<br />
|<br />
{{MethodParam|x|An integer|The on-screen x coordinate of the mouse click.}}<br />
{{MethodParam|y|An integer|The on-screen y coordinate of the mouse click.}}<br />
{{MethodParam|button|An integer|Which button that was pressed. Button 0 is LEFT, 1 is RIGHT, 2 is MIDDLE, 3 is WHEEL UP and 4 is WHEEL DOWN}}<br />
{{MethodParam|clickCount|An integer|This value is usually 1, but if the user clicks the same button rapidly at the same location (within 10 pixels of the previous click), then this value will increase for each click. You can use this to detect double-clicking.}}<br />
}}<br />
=== Example ===<br />
<pre><br />
local function onMouseButton(x, y, button, clickCount)<br />
<br />
print(x .. ", " .. y .. ", " .. button .. ", " .. clickCount)<br />
<br />
if button == 0 then<br />
elseif button == 1 then<br />
elseif button == 2 then<br />
end<br />
<br />
end<br />
<br />
hook.add("mouseButton", onMouseButton)<br />
</pre></div>Jeb