Skip to content

Conversation

@rbreaves
Copy link
Contributor

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
Copy link

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
Copy link
Contributor Author

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.

Copy link

@luizoti luizoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, based in your mod, i made this, i suposse is more simple.

in my repo a add more info in output, necessary to know the current active device.

commit: #131

            print("\nDevice: {}\nWM_CLASS '{}' | active keymaps = [{}] | %s => %s".format(
                    device_name,
                    wm_class,
                    ", ".join(keymap_names
                    )
                ) % (
                    combo,
                    mappings[combo] if combo in mappings else combo
                ), end="\r\n")

@luizoti
Copy link

luizoti commented Apr 28, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants