I was wondering if there was anyway that, using coroutines (possibly) I could pull events without stopping the main flow of the program? Specifically, update monitors with animations while also waiting for bundled cable updates and monitor touches. Could anyone help please?
Thanks!
Pull event without stopping execution?
Started by apemanzilla, Jun 18 2013 07:52 PM
api computer help
2 replies to this topic
#1
Posted 18 June 2013 - 07:52 PM
#2
Posted 18 June 2013 - 08:08 PM
function pullEvents()
while true do
event, etc1, etc2, etc3 = os.pullEvent()
-- Do stuff with the events that get pulled.
end
end
function updateDisplays()
while true do
-- Draw stuff on screens etc.
end
end
parallel.waitForAny(pullEvents, updateDisplays)
#3
Posted 19 June 2013 - 05:16 AM
Bomb Bloke, on 18 June 2013 - 08:08 PM, said:
function pullEvents()
while true do
event, etc1, etc2, etc3 = os.pullEvent()
-- Do stuff with the events that get pulled.
end
end
function updateDisplays()
while true do
-- Draw stuff on screens etc.
end
end
parallel.waitForAny(pullEvents, updateDisplays)2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











