Quick question, i'm writing a gui and i'm using os.pullEventRaw to catch the termination event. However if I use read() it's possible to terminate while entering text. How do I stop this?
os.pullEventRaw
Started by Xenthera, May 07 2013 11:32 AM
4 replies to this topic
#1
Posted 07 May 2013 - 11:32 AM
#2
Posted 07 May 2013 - 11:35 AM
Overwrite pullEvent with pullEventRaw
#3
Posted 07 May 2013 - 11:46 AM
Duh... thanks
#4
Posted 07 May 2013 - 08:13 PM
make sure that you restore it after finished with the read though.
#5
Posted 07 May 2013 - 10:38 PM
local oldpull=os.pullEvent
os.pullEvent=os.pullEventRaw
local function main()
-- do stuff here
end
local a,b=pcall(main)
if not a then
print(b)
os.pullEvent("key")
end
os.pullEvent=oldpull
will catch errors, ensuring it restores
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











