From a93069e3a0d91e0065b056eb8383d7b91edee0ff Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 31 Jul 2011 19:03:15 +0200 Subject: Fix the crash on Escape key --- src/keyboard.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/keyboard.py') 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) -- cgit v1.2.3