summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-06-03 10:01:51 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-06-03 10:01:51 +0100
commitd48ad9e046aac6720eb8fe601bb0a4ef503b1742 (patch)
tree3b9e2a6331026290581301da483f0c8066086f98
parentc1b20b404e014bfdb7f20b6f0d9715727a0f86ed (diff)
downloadkeyboard-python-d48ad9e046aac6720eb8fe601bb0a4ef503b1742.tar.bz2
Fix returning escape codes too early bug
-rw-r--r--keyboardpython/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/keyboardpython/__init__.py b/keyboardpython/__init__.py
index 74f112b..a12f6c7 100644
--- a/keyboardpython/__init__.py
+++ b/keyboardpython/__init__.py
@@ -74,7 +74,7 @@ def getkey(fd='default',timeout=49,buffersize=6):
to_return = str()
timeout = float(timeout) / 1000
c = os.read(fd,buffersize)
- if c != ESC: return key.parse_code(c)
+ if ESC not in c: return key.parse_code(c)
t = termios.tcgetattr(fd)
cc = t[-1]
cc[termios.VMIN] = 0