diff --git a/events.lua b/events.lua new file mode 100644 index 0000000..0a18ef0 --- /dev/null +++ b/events.lua @@ -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