mooz / xkeysnail

Yet another keyboard remapping tool for X environment
891 stars 112 forks source link

Show transformed keys in output #107

Open rbreaves opened 3 years ago

rbreaves commented 3 years ago

Currently if a user presses a key that will be remapped xkeysnail just mentions the key pressed, not the key combo it is being transformed into. This update will append the transformed combo after "=>" if there is a transformed combo available for a specific condition and key combo.

WM_CLASS 'Gnome-terminal' | active keymaps = [Anonymous keymap, Anonymous keymap, terminals]
ENTER

WM_CLASS 'Sublime_text' | active keymaps = [Anonymous keymap, Anonymous keymap, Sublime Text]
RC-LEFT => HOME
WM_CLASS 'Sublime_text' | active keymaps = [Anonymous keymap, Anonymous keymap, Sublime Text]
RC-RIGHT => END
WM_CLASS 'Sublime_text' | active keymaps = [Anonymous keymap, Anonymous keymap, Sublime Text]
LShift-RC-LEFT => Shift-HOME
WM_CLASS 'Gnome-terminal' | active keymaps = [Anonymous keymap, Anonymous keymap, terminals]
RC-T => Shift-C-T
WM_CLASS 'Gnome-terminal' | active keymaps = [Anonymous keymap, Anonymous keymap, terminals]
RC-W => Shift-C-W

WM_CLASS 'Sublime_text' | active keymaps = [Anonymous keymap, Anonymous keymap, Sublime Text]
RC-A
OlegSmelov commented 3 years ago

This doesn't work well when a keybinding is remapped to multiple key combinations, for example:

LM-LEFT => [<xkeysnail.key.Combo object at 0x7f2fced29850>, <xkeysnail.key.Combo object at 0x7f2fced82e80>]
rbreaves commented 3 years ago

Hmmm.. hadn't tested against that, I am guessing then a check needs to be added to properly call & parse out that object type then.

luizoti commented 3 years ago

This doesn't work well when a keybinding is remapped to multiple key combinations, for example:

LM-LEFT => [<xkeysnail.key.Combo object at 0x7f2fced29850>, <xkeysnail.key.Combo object at 0x7f2fced82e80>]

I made a update and now problably will print all type of functions correctly: 046277b