Like for example how do I detect if I press left or right mouse button etc. ?
Would something like this work?
Or how do you use it?
evt, p1 = os.pullEvent()
if evt == "mouse_click" and
p1 == "right" then
--Do stuff
end
Posted 29 March 2013 - 10:30 AM
evt, p1 = os.pullEvent()
if evt == "mouse_click" and
p1 == "right" then
--Do stuff
end
Posted 29 March 2013 - 10:33 AM
while true do
local e = { os.pullEvent() }
if e[1] == 'mouse_click' then
local button, x, y = e[2], b[3], b[4]
if button == 1 then
-- Left click
elseif button == 2 then
-- Right click
end
end
end
0 members, 2 guests, 0 anonymous users