Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Keys
- CtrlQ = 17
- end
- def self.main
- loop do
- if input = STDIN.raw &.read_char
- handle(input)
- end
- end
- end
- def self.handle(char : Char)
- case char.ord
- when Keys::CtrlQ
- exit
- else
- p char.ord
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement