nboard/getkey.py

18 lines
260 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python3
import curses
2022-01-26 21:29:17 -05:00
def main(stdscr):
while True:
k = stdscr.getkey()
2020-07-24 17:13:53 +00:00
2022-01-26 21:29:17 -05:00
if k == "\x1b":
k = ""
2020-07-24 17:13:53 +00:00
for i in range(5):
k += stdscr.getkey()
print(repr(k))
curses.wrapper(main)