Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local pressedKey = nil
- local pressedChar = nil
- function key()
- pressedKey = {os.pullEvent("key")}
- end
- function char()
- pressedChar = {os.pullEvent("char")}
- end
- while true do
- pressedKey = {}
- pressedChar = {}
- parallel.waitForAny(key, char)
- if pressedChar[1] then
- print("char: "..pressedChar[2])
- elseif pressedKey[1] then
- print("key: "..pressedKey[2])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement