summaryrefslogtreecommitdiff
path: root/keyboardpython
diff options
context:
space:
mode:
Diffstat (limited to 'keyboardpython')
-rw-r--r--keyboardpython/key.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/keyboardpython/key.py b/keyboardpython/key.py
index aebc7d5..8795cd4 100644
--- a/keyboardpython/key.py
+++ b/keyboardpython/key.py
@@ -195,27 +195,23 @@ def parse_code(code):
if char == ESC:
if not _code:
key = _special_chars[ESC]
- to_return.add_key(key)
- break
+ return KeyCombination(key)
char = _code.pop(0)
if char == '[':
_code, key_comb = match_start_in_table(_code,
_escape_brace_codes)
- to_return.add_keyCombination(key_comb)
elif char == 'O':
_code, key_comb = match_start_in_table(_code,
_escape_O_codes)
- to_return.add_keyCombination(key_comb)
else:
- to_return.add_key(ALT)
+ key_comb = KeyCombination(ALT)
elif char.isalnum():
- to_return.add_key(Key(char))
+ key_comb = KeyCombination(Key(char))
elif _is_ctrl_alpha(char):
key_comb = _get_ctrl_alpha(char)
- to_return.add_keyCombination(key_comb)
elif char in _special_chars.keys():
- key = _special_chars[char]
- to_return.add_key(key)
+ key_comb = KeyCombination(_special_chars[char])
else:
- to_return.add_key(Key(char))
+ key_comb = KeyCombination(Key(char))
+ to_return.add_keyCombination(key_comb)
return to_return