Live data from Hacker News

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

tkainrad.dev

161–170 of 212 posts

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

#161
post #17

Earlier quoted context omitted.

I didn't know about the US intl layout when I decided to make the switch, and I don't know if it's worth to learn it now.

I used to switch between US and DK layouts, it's just so much easier to just have one layout. In my opinion, learning US Intl is worth it. Besides, it's pretty predictable for Spanish characters: á = altgr+a, é = altgr+e and so on.

Yeah it's great for Spanish. But I found that knowing (and using) native layout is more valuable to me because when I need to type on someone else's keyboard I'm not lost and can still touch type. If you never need to do this US international is indeed superior layout.

Trying to remember more than two layouts becomes confusing very fast. AZERTY and QWERZ are the two worst ones, fortunately I never need to use those.

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

#162
post #9

Dead keys are particularly fun, as it takes two key presses to produce a result. Accessibility of keyboards/layout could indeed be improved. I switched to custom US layout, because of too many issues with a non-US layout. My custom layout uses AltGr combinations to add a few local characters. It is a bit clumsy, but at least keyboard shortcuts work most of the time.

Polish has a "traditional" (typewriter) and "programmer's" (US + AltGr) variants of the keyboard layout. Everyone uses the "programmer's" one, even people who don't know what programming is.

I wish more languages would adopt this.

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

#163
post #138

Earlier quoted context omitted.

Really shows how useful macs having 4 modifier keys (versus PC’s 3) is. Also the better (though not perfect) matching of scopes and modkeys: on macs, command / control / option tend to affect different system areas entirely (with command taking precedence, then control, although control and option are rarely used together).

I do like Cmd+c vs Ctrl+c on a mac. On linux I've changed my terminal to use Ctrl+Shift+c instead of Ctrl+c for ^C because I kept accidentally killing programs when trying to copy text with Ctrl+c which works in every app except terminals...

> I do like Cmd+c vs Ctrl+c on a mac.

It goes way beyond that though: if command’s in a shortcut it pretty much guarantees that’s an application / system shortcut, which frees Ctrl to only deal with text control (and literal control codes in the shell).

And thus Option essentially only does alternate characters.

It’s not perfect, mind, for instance the number of keychords means emacs is annoying whether you leave meta on option or move it to command.

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

#165

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…

> Windows for backwards compatibility reports 'right-alt' as 'alt+control'.

Interesting because on French AZERTY we also have an "altgr" key, and while Windows considers alt-control equivalent (ie. you cant type alt-control-à as well as altgr-à to get an @), typing altgr itself never triggers ctrl or alt shortcuts, it only goes the other way.

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

#166

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…

Question then - what do you use functionally to replace "Escape" in your daily use? As a native English-speaking engineer, the escape button has a history of doing exactly what you're suggesting it not do going back to the beginning of computing.

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

#167

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…

I like to use the qwerty US international. Far better than the Azerty layout which is indeed completely awful.

I do too on Linux, but on Windows that appears to deadkey everything, even apostrophes

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

#168

Earlier quoted context omitted.

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…

I moved to Iceland a year ago, and brought my PC and my laptop with me. I am confounded by icelandic (nordic in general) keyboards. I can understand their use for a non-technical person, but even keys such as @ are obscured behind "Alt Gr" which is a secondary right side only alt-key? And the position of braces, brackets, and parantheses is also clearly an afterthought. Obviously, years of muscle memory are hard to replace, so I've continued to use my US keyboards.

But there's a problem. I want to spell people and places' names correctly, and on my PC that means I have to swap input locales often in order to type proper icelandic characters like ð, ö, þ, æ, í etc. This is annoyingly hard on a keyboard that doesn't support them natively! I will give apple some credit here - it's incredibly easy and intuitive to type foreign characters on a US keyboard just by holding down 'i' for example, if you only occasionally need to use them. Windows requires you to either learn the old-school way of holding alt, and typing the ascii code on the number pad, or hot-swap input languages. I know German uses far fewer unique characters, but how do you cope with that problem when you need German characters like.. sharp S, oumlaut, etc?

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

#169
post #70

Earlier quoted context omitted.

Most keyboard-layouts predate programming-languages, because they were designed for typewrites decades before the first modern computers even existed. So there did gave much to usage of special chara back then. Additionally most languages were designed by americans, on US-layout, which had a great impact on usages of different char in our digital world. Like for example the usage of @, which AFAIK was only used for e…

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

Yes, in english language. Other languages have/had different names, if they even knew it at this point. There was of course a reason why the @ was on the english keyboard-layout, but it was a very different reason from the later usage as location/user-reference. Point is, if e-mail would have been invented in a different culture, there would be a good chance that the symbol wasn't even on their keyboard at the time and a different symbol would likely have been used.

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

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

I think this is an interesting cultural difference.

There is such a thing as a Dutch keyboard layout and keyboard, but almost no one in the Netherlands uses them, as well as configuring one's system to be in Dutch, because it leads to such problems as described.

My entire system is configured in U.S. English, though most of the spelling I use is closer to U.K. English, but I find that it leads to the least problems in practice.

If it were configured to be Dutch, then troubleshooting would be a mess. — this is a common mentality in the Netherlands to never have any electronics or website configured to be Dutch, even when the option allow itself.

Special characters are usually input using the U.S. International layout which which allows one to type, say, “schöne scheiße”. quite easily.

Post reply on HN