Live data from Hacker News

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

tkainrad.dev

151–160 of 212 posts

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

#151
post #70

Earlier quoted context omitted.

> Like for example the usage of @, which AFAIK was only used for e-mail because there was no other free char on the developers keyboard available. '@' meant 'at' looong before e-mail was invented.

But traditionally mainly (only?) in the context of "at [price per unit]", not "at [location]".

In American usage, it has had widespread use as shorthand for “at” in many different contexts, not just in terms of price per unit fir quite a while; some of them.may have been catalyzed by thr usage in email, but I think enough are older that email fits into an existing pattern rather than creating a new one.

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

#152
My favorite recent WTF:

On French keyboard, the numbers 0-9 and special chars (#$&@...) are swapped, so you need "shift+" to type in a number. Effect on the web compat:

A phone number validator on French lowcost railway website was built/tested with French keyboard only; they were checking input codes in JS on each keypress and only allowing the presses of certain keys with shift enabled. Since you can't type a number on QWERTY with shift enabled, I was unable to complete the form until I realized what's up by reading the JS and switched to AZERTY layout.

(copy-pasting into the input didn't work either)

---

Unrelated aside: as I was raised in Poland which is based on US QWERTY and all programs using US shortcuts (with the only quirk being AltGr mentioned in other comments), I was mind blown than in other countries it's customary to localize shortcuts.

For example in Spain in notepad.exe, save is not CTRL-S but CTRL-G ("guardar").

In France, you don't bold in Excel with CTRL-B, you bold with CTRL-G ("grossir"). For some reason Excel online only lets me use the FR version despite settungs all possible locale settings to en and this drives me nuts.

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

#153

There is also a whole slew of issues with Polish characters. Polish keyboard setup relies on "right-alt" and a letter to get it's diacritics variation. Ie: 'ą' is 'right-alt'+a Windows for backwards compatibility reports 'right-alt' as 'alt+control'. Many applications developers assign key combos with no negative checks. So 'ctrl-s', typically used for save gets triggered when user wants to type 'ś'. To repeat, "righ…

I remember ATI Catalyst Control Center (GPU settings panel) infamously binding Alt+Ctrl+C systemwide to launch itself.

So when you wanted to type 'ć' in any program in Windows, it would not work, and launch CCC instead.

Luckily the shortcuts were user-modifiable. So first thing to do on Windows after installing GPU drivers was to disable this hotkey.

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

#154
post #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.

I solved it by buying a UK layout keyboard for home. At work I confuse the hell out of people by using a German keyboard but UK layout.

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

#155

TL;DR. Don't use keypress, it's deprecated. Don't use 'keyCode', 'which', 'char' which are all deprecated. Do use 'key' Another issue I run into is forms that dismiss via keydown and escape. I type in Japanese which means I'm using an IME. An IME, or at least the Japanese IME, you type characters and they appear with possible completions. They haven't actually been given to the app yet. Pressing Escape cancels the co…

Or even better, do not put form in a closable dialog / "things"

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

#157

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. Thes…

You can use other software to remap the keys to your liking, for example MSKLC on Windows.

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

#158
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.

Last time I needed a new laptop (my old one died) I took a 8 hour train to travel to the Netherlands from Munich instead of back home to Berlin (where I live) just so I could visit a store that has laptops with a non German layout (US international). The only way to get a non German keyboard in Germany is to order them online and wait for a week+ (typically) for that to ship internationally (because they don't stock these locally). That was clearly unacceptable. So, 8 hour train ride it was because I needed a replacement in a hurry and I got to visit my parents. Win win.

The alternative would have been buying a laptop with literally every key I care about in the wrong place in some local store. It's great that alternate keyboard layouts are available to those that actually need/want them but it really sucks that you get locked into these choices just because of where you are. Local shop owners don't seem to have any commercial sense whatsoever. Here's a genius idea in a city full of expats (Berlin, Munich), you know, maybe stock a few laptops with international keyboards. Even the local Apple store doesn't do that. And any time you go there, a very meaningful percentage of the customers is clearly not German.

Every non German buying a German keyboard because they have to is basically an unhappy customer. I know loads of foreigners here moaning about German keyboards. I've never met a non German that actually prefers having keys in the wrong place. That's not a thing; it's bloody annoying. It's equally annoying in other countries where expats live. E.g. French keyboard layouts are worse, AZERTY instead of QWERTY. At least in Germany you get QWERTZ (Y and Z are swapped). I've actually met quite a few German programmers that remap their keyboards so they can program without having to use four fingers to produce a single key-press.

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

#159

I mostly write in English (plus Clojure, shell, and C#), but often also in Spanish, French and Finnish. I've found that a standard QWERTY/US layout with a Compose key is the best option. It gives you a decent layout for coding and shell related characters, and all diacritics (and plenty more) are a 3 keystroke chain away (with no chording). Even when writing French, which requires a lot of accents, I find it more flu…

Yeah US layout + Compose key is also my setup.

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

#160
post #36

It's not just international keyboards that are affected by this. I'm a Dvorak user so I run into these issues from time to time. As the article explains, there is a difference between the physical keyCode and character it corresponds to. Which to use really depends on what it is being used for, and there are situations for both. The article suggests checking the character typed, but this is not always the correct way…

> 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..

> Is it even possible to do anything else? I can’t imagine keyboards report their physical layout..

You can easily ask the OS what layout is being used or even ask the user.

Post reply on HN