summaryrefslogtreecommitdiff
path: root/src/keyboard.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-07-31 19:03:15 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-07-31 19:03:15 +0200
commita93069e3a0d91e0065b056eb8383d7b91edee0ff (patch)
tree3333695be1ef5aed898b7021348c9fb1a255c483 /src/keyboard.py
parentc2ba5388a5cf85cc8d4424d41f5ad0dab51c383b (diff)
downloadpoezio-a93069e3a0d91e0065b056eb8383d7b91edee0ff.tar.gz
poezio-a93069e3a0d91e0065b056eb8383d7b91edee0ff.tar.bz2
poezio-a93069e3a0d91e0065b056eb8383d7b91edee0ff.tar.xz
poezio-a93069e3a0d91e0065b056eb8383d7b91edee0ff.zip
Fix the crash on Escape key
Diffstat (limited to 'src/keyboard.py')
-rw-r--r--src/keyboard.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/keyboard.py b/src/keyboard.py
index f3dd14db..5fee7444 100644
--- a/src/keyboard.py
+++ b/src/keyboard.py
@@ -63,6 +63,9 @@ def read_char(s, timeout=1000):
continue
if first == 27:
second = read_char(s, 0)
+ if second is None: # if escape was pressed, a second char
+ # has to be read. But it timed out.
+ return None
res = 'M-%s' % (second[0],)
ret_list.append(res)
(first, char) = get_next_byte(s)