Advertisement
Guest User

linuxArrowTest

a guest
Oct 17th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import curses
  2.  
  3. screen = curses.initscr()
  4. screen.addstr("Press any key...")
  5. screen.refresh()
  6.  
  7. # Convert the key to ASCII and print ordinal value
  8. while True:
  9. c = screen.getch()
  10. print("You pressed %s which is keycode %d." % (chr(c), c))
  11.  
  12. curses.endwin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement