Skip to content

Commit

Permalink
Fix for not working key combos (Issue pyatom#43).
Browse files Browse the repository at this point in the history
  • Loading branch information
ladza committed Feb 24, 2014
1 parent e2faa81 commit d6ebafb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions atomac/ldtpd/keypress_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,22 @@ def get_keyval_id(self, input_str):
else:
token=input_str[index]
index += 1

key_val=self._get_key_value(token)
# Deal with modifier and undefined keys.
# Modifiers: if we got modifier in previous
# step, extend the previous KeyCombo object instead
# of creating a new one.
if lastModifiers and key_val.value != self._undefined_key:
last_item=key_vals.pop()
last_item.value=key_val.value
key_val=last_item
lastModifiers=None
last_item = key_vals.pop()
if key_val.modifiers:
lastModifiers = key_val
last_item.modVal.extend(key_val.modVal)
key_val = last_item
else:
last_item.value = key_val.value
key_val = last_item
lastModifiers=None
elif key_val.modifiers:
if not lastModifiers:
lastModifiers=key_val
Expand Down

0 comments on commit d6ebafb

Please sign in to comment.