Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EButtons = { Left = 1, Right = 2, Middle = 3 }
- local function leftClickHandler()
- while true do
- local _, button, x, y = os.pullEvent("mouse_click")
- if (button == EButtons.Left) then
- print(("Left button was pressed at %d, %d"):format(button, x, y))
- end
- end
- end
- local function rightClickHandler()
- while true do
- local _, button, x, y = os.pullEvent("mouse_click")
- if (button == EButtons.Right) then
- print(("Right button was pressed at %d, %d"):format(button, x, y))
- end
- end
- end
- parallel.waitForAll(leftClickHandler, rightClickHandler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement