Mouse click (event)
From ComputerCraft Wiki
Revision as of 17:00, 16 December 2012 by AfterLifeLochie (Talk | contribs) (Reverted edits by 62.194.241.150 (talk) to last revision by AfterLifeLochie)
Examples
| Print the button and the co-ordinates of every mouse click we receive a mouse_click event. | |
| Code |
while true do
button, xPos, yPos = os.pullEvent("mouse_click")
print("mouse_click: " .. tostring(button) .. ", " ..
"X: " .. tostring(xPos) .. ", " ..
"Y: " .. tostring(yPos))
end
|
| Output | The button that was pressed, followed by the X and Y position of the event. |