mouse click (event)
From ComputerCraft Wiki
Revision as of 16:40, 13 December 2016 by Latias1290 (Talk | contribs) (pressing extra mouse buttons are registered as left mouse button)
Examples
Example | |
Print the button and the co-ordinates of every mouse click we receive. | |
Code |
while true do local event, button, x, y = os.pullEvent( "mouse_click" ) print( "The mouse button ", button, " was pressed at ", x, " and ", y ) end |
Output | The button that was pressed, followed by the X and Y position of the event. |