Mouse click (event)
From ComputerCraft Wiki
Examples
Example | |
Print the button and the co-ordinates of every mouse click we receive a mouse_click event. | |
Code |
while true do local event, button, xPos, yPos = os.pullEvent("mouse_click") print("Mouse button clicked: ", button, " => Click Position X: ", xPos, " => Click Position Y: ", yPos) end |
Output | The button that was pressed, followed by the X and Y position of the event. |