Skip to content

Commit

Permalink
- Show transformed keys in output
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreaves committed Oct 27, 2020
1 parent a28a6ec commit 77ba71e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xkeysnail/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def on_key(key, action, wm_class=None, quiet=False):
def transform_key(key, action, wm_class=None, quiet=False):
global _mode_maps
global _toplevel_keymaps
transformed = False

combo = Combo(get_pressed_modifiers(), key)

Expand All @@ -456,19 +457,22 @@ def transform_key(key, action, wm_class=None, quiet=False):
if not quiet:
print("WM_CLASS '{}' | active keymaps = [{}]".format(wm_class, ", ".join(keymap_names)))

if not quiet:
print(combo)

# _mode_maps: [global_map, local_1, local_2, ...]
for mappings in _mode_maps:
if combo not in mappings:
continue
# Found key in "mappings". Execute commands defined for the key.
reset_mode = handle_commands(mappings[combo], key, action)
if not quiet:
print("{} => {}".format(combo,mappings[combo]))
transformed = True
if reset_mode:
_mode_maps = None
return

if not quiet and not transformed:
print(combo)

# Not found in all keymaps
if is_top_level:
# If it's top-level, pass through keys
Expand Down

0 comments on commit 77ba71e

Please sign in to comment.