Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI('keyboard')
- keyboard.setup('left')
- local display = ''
- keyboard.render()
- while true do
- term.setCursorPos(1,1)
- print((display or 'nil')..' ')
- local event = { keyboard.pullEvent() }
- if event[1] == 'char' then
- display = display..event[2]
- elseif event[1] == 'key' then
- if event[2] == keys.backspace then
- display = display:sub(1, #display - 1)
- elseif event[1] == keys.enter then
- display = display..'\n'
- end
- end
- keyboard.render()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement