cc-stuff/events.lua

16 lines
389 B
Lua

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