rbreaves / kinto

Mac-style shortcut keys for Linux & Windows.
http://kinto.sh
GNU General Public License v2.0
4.24k stars 212 forks source link

Pop! OS Both cmd key's mapped to right Ctrl #825

Closed lmyslinski closed 10 months ago

lmyslinski commented 10 months ago

Describe the bug Hi, thanks for this great tool - I've had some initial problems on Fedora, but after switching to Pop OS everything works pretty fine. I did however encounter a few issues, perhaps some of which other users managed to solve already:

Thanks for taking the time to read this, let me know if I can somehow help to resolve this issue.

Expected behavior A clear and concise description of what you expected to happen.

Install Type: Bare Metal Distro: OS: Pop!_OS 22.04 LTS x86_64 DE: Gnome Branch: master Commit: 1.2-13 build 99a8566

RedBearAK commented 10 months ago

@lmyslinski

(I'm not the Kinto dev, just a user and contributor.)

Most importantly: Both Cmd keys are mapped to Right Ctrl (using a Keychron k3 pro with a Windows setting, not sure if relevant). For this reason, I can't remap the left cmd to act as an input modifier, making any locale-specific characters impossible to use.

Kinto has a "tweak" for this that you can enable, it stops remapping the Alt key (PC keyboards) or Cmd key (Apple keyboards) on the right side so you can use it as Alt_Gr for level 3/4 characters, if that is supported on your keyboard and desktop settings. I'm assuming that's what you're referring to.

I don't know how easy it would be to switch it to using the key next to the space bar on the left side instead of on the right. Might work, but you'd have to modify the modmap responsible for remapping the modifiers for an Apple keyboard. But the usual key for this is the right-side Alt (or Cmd in the case of an Apple modifier layout).

Secondly, what is the intended way to further customize the keymap? I can either modify the built-in gnome keyboard settings, or dive into kinto remaps. The first option is much easier, but I'm not sure if won't break any stuff internally

Well, you can do practically anything with the config file, it's all Python. In my own project that is an offshoot of Kinto's config I've done all kinds of things, including implementing the Option-key special characters from two different Apple keyboard layouts. My project's config file is over 4K lines long now. It's kind of crazy.

The question is more what you want to customize.

Thirdly, all terminal applications seem to hijack global shortcuts. As soon as I open gnome terminal (or any other terminal), I no longer can use any global shortcuts like switch to workspace, app launcher etc. Weirdly enough, Cmd+tab still works though.

A choice was made to keep the physical Ctrl key as Ctrl in terminals, since that is a commonly needed key for shortcuts specific to the terminal. But outside of terminals that key becomes the Meta/Super/Win/Cmd key. With each Linux desktop environment there is a different set of shortcuts to do things like switch workspaces. Some attempt is made in the config to keep some of those commands working. Remember that Kinto has the goal of making things work like macOS, not necessarily retaining any Linux shortcuts.

But the way you say it "hijacks global shortcuts" and mention "app launcher" has me a little confused. Unless you're using the physical Ctrl key (by itself) to open the app launcher on Pop!_OS, which would work only when not in terminals (because the Meta/Super/Win/Cmd key doesn't exist anywhere on the keyboard while you are in a terminal.

The way Kinto tries to keep app launchers accessible is by remapping the Spotlight Cmd+Space shortcut to something appropriate for the desktop environment, which is usually Alt+F1, or sometimes Ctrl+Esc (Xfce Whisker Menu). But sometimes you need to make sure that the launcher you want to use has Alt+F1 set as its shortcut, or change the line in the config file to remap "RC-Space" to something else to activate the app launcher you want to use.

This is one of the most common things that needs to be customized by the user. All of this is pretty much inherited by my own project and works the same way.

lmyslinski commented 10 months ago

Kinto has a "tweak" for this that you can enable, it stops remapping the Alt key (PC keyboards) or Cmd key (Apple keyboards) on the right side so you can use it as Alt_Gr for level 3/4 characters, if that is supported on your keyboard and desktop settings. I'm assuming that's what you're referring to.

Will try that out, thanks. I'm a bit confused, as I think this part worked before I started tweaking some other stuff in Gnome. I do see that this is supposedly taken care of in kinto, with the following remaps:

    K("RC-e"):          K("Alt-e"),

However this is only found at :

define_keymap(re.compile("^ulauncher$", re.IGNORECASE),...

Seems odd. Anyhow, I'm trying to apply what you're mentioned with Alt_gr - When I have the default kinto setting on, the key on the right side of spacebar is registered as Right Ctrl - When I disable kinto, it works as expected (Alt), xev shows this keypress as ISO_Level3_Shift (weird again) - I guess all I need is to find a way to bring back the default mapping for this key

lmyslinski commented 10 months ago

Commented out # Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove) and all is good. Thanks a lot, I see that the launcher will be dead easy to fix too.