Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 412 Bytes
from ctypes_termkey import TermKey, Result, KeyType, KeyModifier
tk = TermKey()
result_str_map = {
Result.NONE: 'None',
Result.KEY: 'Key',
Result.EOF: 'EOF',
Result.AGAIN: 'AGAIN',
while True:
result, key = tk.waitkey()
print "*** result", result_str_map[result]
keystr = tk.sprint_key(key)
print " keystr", repr(keystr)
if keystr == 'C-C':
Something went wrong with that request. Please try again.