forked from hkc/cc-stuff
Added simple event printer
This commit is contained in:
parent
e780d7017e
commit
0e047a5b35
|
@ -0,0 +1,15 @@
|
||||||
|
local pretty = require("cc.pretty")
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local evd = { os.pullEvent() }
|
||||||
|
local ev, evd = table.remove(evd, 1), evd
|
||||||
|
if ev == "key_up" and evd[1] == keys.q then
|
||||||
|
break
|
||||||
|
elseif ev == "term_resize" then
|
||||||
|
local w, h = term.getSize()
|
||||||
|
print("term_resize", w, h)
|
||||||
|
else
|
||||||
|
io.write(ev.." ")
|
||||||
|
pretty.print(pretty.pretty(evd))
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue