summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/keyboard.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/keyboard.py b/src/keyboard.py
index ffc7dd60..240cc2c8 100644
--- a/src/keyboard.py
+++ b/src/keyboard.py
@@ -92,6 +92,9 @@ def get_char_list_new(s):
except curses.error:
# No input, this means a timeout occurs.
return ret_list
+ except ValueError: # invalid input
+ log.debug('Invalid character entered.')
+ return ret_list
s.timeout(0)
if isinstance(key, int):
ret_list.append(curses.keyname(key).decode())
@@ -104,6 +107,9 @@ def get_char_list_new(s):
part = s.get_wch()
except curses.error:
pass
+ except ValueError: # invalid input
+ log.debug('Invalid character entered.')
+ pass
else:
key = 'M-%s' % part
# and an even more special case for keys like
@@ -114,6 +120,9 @@ def get_char_list_new(s):
part = s.get_wch()
except curses.error:
pass
+ except ValueError:
+ log.debug('Invalid character entered.')
+ pass
else:
key = '%s-%s' % (key, part)
if key == '\x7f' or key == '\x08':