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

(Question) Rebinding cmd key to show GNOME app menu after installing toshy? #398

Open
xaviqo opened this issue Sep 16, 2024 · 3 comments
Open
Assignees
Labels
question Further information is requested

Comments

@xaviqo
Copy link

xaviqo commented Sep 16, 2024

First of all, I want to thank you for the incredible work behind this application.

Is there any way to rebind the cmd key (or another) to show the GNOME app menu again? My intention is to bind it to a mouse button using Soolar, but I believe I need to rebind it to the keyboard first.

I’m using:

Fedora 39 - GNOME Shell 45.9 - Wayland

Thank you so much!

@xaviqo xaviqo added the question Further information is requested label Sep 16, 2024
@RedBearAK
Copy link
Owner

@xaviqo

Here is the fundamental problem with the modifier-only shortcuts that a lot of Linux desktop environments like to use (particularly the Meta/Super/Win/Cmd key code, but also some apps focus the menu bar when you press Alt). Modifier-only shortcuts cause an action by just pressing the modifier key by itself. This is contrary to how all other keyboard shortcuts work, where the modifier is... a modifier.

You can re-enable the Super key action in GNOME, with a simple terminal command. But the Super key only exists on the keyboard when you are not using a "terminal" app, and will be located on the physical Ctrl key. And it interferes with certain Super+key shortcuts.

Are you able to bind a shortcut combo to the mouse button with Solaar, rather than just a "key"? If so, you can use the same combo that Toshy establishes in GNOME 45 and later, to show the Overview. Which is Shift+Ctrl+Space.

        overview_binding = "['<Shift><Control>space']"
        cmd_lst = ['gsettings', 'set', 'org.gnome.shell.keybindings',
                    'toggle-overview', overview_binding]

As far as I know, as long as you can get the mouse button to send the same shortcut that Toshy is mapping Cmd+Space onto, there's no need to re-enable the Super key action, since it will be activating the independent toggle-overview shortcut.

If for any reason you still want to re-enable the Super key overlay-key shortcut, there's a FAQ entry showing the relevant commands to enable or disable the overlay-key action:

https://github.com/RedBearAK/toshy/wiki/FAQ-(Frequently-Asked-Questions)#gnome-and-the-metasuperwincmd-key-overlay-key

Unfortunately overlay-key can only be set to a single key, so there's no other way to "fix" it and keep it from interfering with Super+key shortcuts. It also can only be set to either Super_L or Super_R, but not both. This is a big irritation for some GNOME users, even if they aren't using Toshy.

Let me know if you have any other issues.

@RedBearAK
Copy link
Owner

If Solaar can only assign a single key code to the button, we might still be able to make it work without re-enabling overlay-key, by assigning something like F19 to the mouse button, and then using a keymap in your config file to remap that key onto the full shortcut.

That would depend on the device being "grabbed" by the keymapper, which can be seen in the verbose output from:

toshy-debug

And such a solution would of course only work while Toshy is enabled. The button would otherwise cause no action.

Hopefully the software can bind the full shortcut to the button.

@RedBearAK
Copy link
Owner

RedBearAK commented Sep 16, 2024

And this is unrelated, but since you may be in Barcelona (according to your GH profile), I should mention this. If you aren't using a US keyboard layout, you may find a few keyboard shortcuts to be not working as expected (they may act as if you are using a US English keyboard layout instead of a Spanish layout). There are several discussions about this fundamental problem with Linux keymappers in the open issues. There are a couple of things you can do to partially overcome the problem, if you even run into it. It only affects things that are "remapped" in the config file. Or macros that "type" strings out.

Feel free to open a separate issue if you end up needing to deal with some aspect of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants