This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nateracecar5's profile picture

Run two os.pullEvents() at once

Started by nateracecar5, 09 January 2013 - 01:13 PM
nateracecar5 #1
Posted 09 January 2013 - 02:13 PM
Okay, so I am working on an OS (big whoop) and I have a menu that uses keyboard input and mouse input so I have a os.pullEvent("key") and a os.pullEvent("mouse_click"). I need to be able to use both of these at once, but they seem to be not working at the same time.
theoriginalbit #2
Posted 09 January 2013 - 02:22 PM
this is because when supplying a parameter to os.pullEvent it ignores all other events. so do this


local event, param, x, y = os.pullEvent()

if event == "key" then

elseif event == "mouse_click" then

end