summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-05-30 19:29:56 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-05-30 19:31:33 +0100
commit0ee02ee1541da7cbd876b3167c8432fa885c47c2 (patch)
tree85e3938fa3d672423db1cd3b08c59640fd1288ac
parentde73045758d138d4dd6227fa9ee43562087fa96f (diff)
downloadkeyboard-python-0ee02ee1541da7cbd876b3167c8432fa885c47c2.tar.bz2
Check for ctrl+alpha after special chars
so that is_ctrl_alpha doesn't have to check
-rw-r--r--keyboardpython/key.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/keyboardpython/key.py b/keyboardpython/key.py
index e7ec36c..c4b7a2d 100644
--- a/keyboardpython/key.py
+++ b/keyboardpython/key.py
@@ -158,12 +158,8 @@ def _is_alt(code):
def _is_ctrl_alpha(code):
''' is this the code of a combination modified by Ctrl? '''
- import sys, termios
_assert_type(code,str)
- fd = sys.stdin.fileno()
- cc = termios.tcgetattr(fd)[-1]
- if code in cc: return False
- elif code in _special_chars.keys(): return False
+ if code in _special_chars.keys(): return False
elif code < '\x20': return True
else: return False
@@ -207,10 +203,10 @@ def parse_code(code):
key_comb = KeyCombination(ALT)
elif char.isalnum():
key_comb = KeyCombination(Key(char))
- elif _is_ctrl_alpha(char):
- key_comb = _get_ctrl_alpha(char)
elif char in _special_chars.keys():
key_comb = KeyCombination(_special_chars[char])
+ elif _is_ctrl_alpha(char):
+ key_comb = _get_ctrl_alpha(char)
else:
key_comb = KeyCombination(Key(char))
to_return.add_keyCombination(key_comb)