Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show transformed keys in output #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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.

None yet

3 participants