That's what actually happens everywhere. For instance undo is usually CTRL+Z. On QWERTY that will be CTRL + the key at the left side of the X, and on AZERTY that will be CTRL+the key at the left side of the E. Therefore, that's the behavior people expect and it has advantages. Having to write KEY_Z to actually have KEY_W is also jarring and very counter-intuitive. That also means UIs don't have to translate key bindings, unless they want them to correspond to some word (for instance word processors have CTRL+B for bold in English, but CTRL+G is allowed in French (Bold = Gras).
Now I also understand the benefits of your choice, and I appreciate that nobody is entitled to make you change this in any case. At worse everybody should be thankful for your choice to release this work as open source and spend time on it to the benefit of everyone. I'm also not a user so I don't have any stake in this.
- a keysym (the letter Z, wherever it happens to be in your current layout)
- or a keycode/scancode (the physical button under your pinky, no matter the current layout)
I use both methods for different bindings. For example I've bound the vim keys (hjkl) by scancode, and the layout keys ("S"tack, "F"ullscreen, "R"esize, etc) by symbol.
In my case I'm not sure what I prefer. When switching from AZERTY to QWERTY, I'm lost because the keybindings are not the same. Especially that CTRL+Z "becomes" CTRL+W which kills the current tab, and CTRL+W "becomes" CTRL+Q which kills the app.
OTOH, I don't usually switch layouts, and like that the configuration file / the UI matches the current layout.
I guess the conf could allow setting layout-specific keybindings. It complicates things quite a bit though.
I saw a few games where it wasn't that way, it was always treated as a bug.
Think of it from the user side: People are used to their shortcuts. They are used to press CTRL+Z where it is on their layout, as their keyboard keys will also be printed accordingly. Someone with a non-qwerty-layout may have never seen CTRL+Z leading to the physical key on the bottom left, for them it was always somewhere else. How would they know what to press, when the config says CTRL+Z, and they press CTRL+Z on their keyboard and nothing happens? How would someone who grew up with azerty know qwerty?
If you want to support "what people actually use", the keypresses have to be evaluated according to the actual keyboard layout used. I say this with absolute certainty, and as a multilingual developer who switched from qwertz to qwerty and had azerty in use as well for a time.
That’s emphatically not what happens everywhere. It might be what happens everywhere people use a single Latin layout, but if you use two layouts or more you definitely want things to stay on the same physical key regardless of any switching—your muscle memory is bound to hate you otherwise.
For example, I expect CUA cut to be Ctrl-X, but also Ctrl-Ч and Ctrl-ס. This is how it works on all graphical desktops I’ve used and also, with some work, in Vim. (Not in Kakoune, though, which is a substantial annoyance.)
Yes, exactly what happens when I switch from AZERTY to QWERTY. Everything is messed up.
Now my use of everywhere was abusive, I guess not everywhere. It can't be Z if Z is not on your keyboard.
But then, I'm an X user still; I'd like to dip into Wayland, but a combination of fragmentation of protocols and the seeming relative “hardness” of the stack in terms of customizability have caused me to hesitate thus far. And maybe that Windows behavior also means that's what you want to mimic for a lot of other people?
Perhaps this is also a frequency of use issue— if you're relying on the mnemonic rather than muscle memory, it sounds like a shortcut you don't use very often.
Or does muscle memory for you come in at a different layer somehow, where the mapping to key locations is basically automatic and instant but you do still consider key names as you navigate hotkeys?
I wonder sometimes whether it's relevant that I'm a heavy Emacs user, in which short command gestures often include non-modified keys and are conceptually close to the physically more text-based M-x invocations. Maybe that type of experience (or what other types? Maybe CLI?) creates a different mental map of the distinction or lack thereof between text entry and shortcut keymaps. Emacs on Windows is especially awkward for me as a result of the QWERTY-on-Control behavior, because e.g. C-x C-t and C-x t now involve different positions for the T. Or maybe people who start out on non-QWERTY layouts on Windows specifically are pushed to remember shortcuts by their location early because the keysyms are illogical, and then they continue doing that, but people who stay on QWERTY all the time could go either way?
As others have mentioned, this also doesn't happen as much in gaming, where commands are often bound positionally, with WASD motion (GAST motion in my layout…) as a central example. There's still some expected-keysym mnemonic influence in which of multiple candidate keys to bind to a function as one moves away from the central motion cluster. The vi keys mentioned elsewhere are also very positional in nature, but I rarely use vi bindings, and when I do, the nav-cluster keys are usually an accepted alternative…
Gosh. With how much has wound up in this thread, I kind of wonder whether there's more serious ergonomics research on this difference in mental modeling now.
Personally, yes. If I am in Qwerty and I press the T key, I press the button where T is physically in Qwerty. If I am in Dvorak, I press the button where T is physically in Dvorak. Pressing the button where something is physically in Qwerty when I am in another layout would be very confusing, because effectively it would be that everything else is respecting the layout I am using except this one program that is still using the Qwerty positions of the keys.
That said, maybe I'd have an easier time if it were possible to find a physical Dvorak keyboard, but alas: "worse is better".
OT: Wayfire is a really cool project and I admire how well it runs, it's real quality software.
As a colemak user, definitely. It's a super weird and confusing experience otherwise and this bug is a blocker for me checking out your (otherwise quite promising-looking) project.
As a vim user, I am hugely relying on muscle memory - which is why saying that bindings should vary between layouts seems really weird, as that would make muscle memory way less effective. Then again, that is my usage ..
If the key on keyboard stays the same, even though the layout changes, it really messes with the way my brain maps from letters to muscle movements, idk if this makes sense.
It depends. As a counterpoint to the folks replying "yes", I have for years had Meta-[1..9] bound to "switch to desktop X". I also regularly use US English and Czech/Slovak keyboards.
In the X11 days, I never had to think about this, since for whatever reason (I believe technically a bug and/or X11-specific WM behaviour, but I've lost the reference...) Openbox would use the US English layout for its keybindings exclusively.
Since I switched to KDE Plasma on Wayland, I constantly get annoyed, every day, as I may have my keyboard set to SK, press what muscle memory says is Meta-[1] and instead I get a funky zoom, since that keystroke translates to Meta-[+] in the SK layout :-(
A particular physical key... on a QWERTY keyboard. But we don't have QWERTY keyboards, so having to bind something to KEY_Q when you want it to map to an A is stupid.
This idea is corroborated if you look in the USB HID Usage Tables that the Linux input event codes are based on. From https://usb.org/document-library/hid-usage-tables-14:
> Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate other languages.
This can get somewhat more complicated when you get into keyboards with custom remapping firmware where they do actually shift the scancodes around, but that creates other potential issues, and users who are doing that basically just have to deal with their own integration tradeoffs. Similar considerations apply to keyboards with non-mainstream physical layouts.