Keyboard input/Keypress check: Difference between revisions

Line 479:
while True:
if char is not None:
print("Key pressed is " + char.decode('utf-8'))try:
print("Key pressed is " + char.decode('utf-8'))
except UnicodeDecodeError:
print("character can not be decoded, sorry!")
char = None
_thread.start_new_thread(keypress, ())
if char == 'q' or char == '\x1b': # x1b is ESC
Anonymous user