Live data from Hacker News

Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

tkainrad.dev

111–120 of 212 posts

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#111
post #28

As a kid, I remember being utterly confused, when most games with a console would have the key ` to open it. WTF is the key ` and where is it? For a kid it wasn't that easy to understand that there are such things as different keyboard layouts. Turns out that ` is a single key press to the left of the '1', in English, while it is a bit obscure character to write in other languages. In mine, you have º and ª in that p…

I remember that too. But the console you only open sometimes. But everyday(!), I have to use {[(| ... and they are just awkward to reach on a german layout.

You might find https://neo-layout.org very useful for daily use. They provide a version that bolts the utility layers onto qwertz as well.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#113
They had me until:

> This means when the key combination is alt+/, the shortcut should be triggered when a german layout user presses alt+shift+7.

No way. I want to press alt+dash, which is in the same place as alt+/ on a US keyboard. Pressing alt+shift+7 is the equivalent of Lee-Harvey-Oswald-grade marksmanship on a keyboard.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#114
post #15

On a tangent, why are non-qwerty keyboards so poorly designed for programming? And specifically, why is apple’s azerty layout so terrible? Just look at this image: https://i.stack.imgur.com/3LL8a.png Can you find the [ and ] keys? If you’re having trouble, it’s because you have to use 2 (two!) modifier keys and activate the ( or ) keys, which themselves are clumsily placed. This cannot be typed one-handed in a comfor…

Honestly that's one of the reasons I'm happy with the Logitech Craft: it lets me use a proper Azerty layout yet silent like the Apple keyboards (plus I can control both my computers from a single keyboard, but that's more an edge case).

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#115
post #36

Earlier quoted context omitted.

> For instance, the most annoying are games which default to WASD based on the letter typed and not the physical keys Is it even possible to do anything else? I can’t imagine keyboards report their physical layout..

The only possibility is to allow the user to assign custom keys, which is pretty common. It’s impossible to know the physical layout for absolute certainty. For all you know, my “Enter” could be a pedal under the desk.

In X11 with the Xkb extension you can configure simplified vector drawings of your input devices, which any application can query. It is intended that applications use these drawings in their help systems and tutorials, as well as in their key binding editors. Few applications bother though.

https://www.x.org/releases/current/doc/libX11/XKB/xkblib.htm...

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#116
Honestly don't wait on all the web Dev to fix their app. Buy yourself a programmable keyboard that tells the computer they are a "normal US layout keyboard".

Now when you press "shift+7" on your keyboard it only sends "regular US keycode for /"

As a benefit you'll maybe also realize that Azerty or Qwertz are pretty bad layout for typing French/German, and you'll come up with something better.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#117

One of many reasons i switched from a Euro ISO layout to a QWERTY ANSI layout a while ago. It took me about 3 weeks to get comfortable with QWERTY ANSI, plus another 2 months to fully get back to my regular typing speed. 100% worth it tho if you need a bunch of special characters as you regularly do with most programming languages. Some tips: - switch out ALL you keyboards, at home, at work, on all devices - use EurK…

What kind of bothers me is that while many accented letters are available just by pressing AltGr/ShiftAltGr/etc, common Slavic ones (č, š, ž...) aren't. You have to use dead keys to type them, which defeats the purpose. You can already type them in a similar way on macOS by just holding down the original letter on a Mac Canadian/Australian/EngIntl layout, but that's a pain for pretty much anyone who types a lot. These letters are used often enough to have their own keys on many localized keyboard layouts.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#118
So what to do about mnemonics? What about keyboard placement?

> This means when the key combination is alt+/, the shortcut should be triggered when a german layout user presses alt+shift+7.

Really? The / is conveniently accessible on a US layout; shift+7 isn't. So this gains you the benefit that you don't have to change documentation (it is "/" however you type it), but much less usable on other layouts. Alternatively, you could try to use the key in the same physical position, but - is already used for other shortcuts due to its meaning.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#119
post #15

On a tangent, why are non-qwerty keyboards so poorly designed for programming? And specifically, why is apple’s azerty layout so terrible? Just look at this image: https://i.stack.imgur.com/3LL8a.png Can you find the [ and ] keys? If you’re having trouble, it’s because you have to use 2 (two!) modifier keys and activate the ( or ) keys, which themselves are clumsily placed. This cannot be typed one-handed in a comfor…

The neo2 layout took this into account, (), [], {} and are under your strongest fingers.

Re: Why keyboard shortcuts don't work on non-US layouts and how devs could fix it

#120
post #3

> For example, on my German layout, / is produced via Shift+7. This is my #1 annoyance with German keyboards as someone who learned a UK layout and who needs to do lots of programming and terminal hacking (#2 is the swapping of Y and Z). I take it this layout was invented before Unix and its heavy use of forward slashes, but it does show how shortcuts are rather discriminatory. I know more than a few Germans who use…

Check out the neo layout, optimized for programming, writing german and english.
Post reply on HN