Live data from Hacker News

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

tkainrad.dev

101–110 of 212 posts

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

#101
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 EurKey* for reaching special keys in your language (french, german, whatever...)

* https://eurkey.steffen.bruentjen.eu

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

#102
post #83
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…

> In mine, you have º and ª in that place... Out of curiosity, what keyboard layout do you use?

Don't know about parent, but latin-american keyboard is like that.

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

#103
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 completions. But webpages that cancel some model form dialog via escape means that if I press ESC to cancel IME completion (which is common) I also cancel the dialog and lose all input had previously entered into the form.

I'd think this would been solved at the browser level, if the IME is active then don't pass keys to the app but for probably valid reasons that's not what happens.

TL;DR don't use escape to cancel a model form!

edit: apparently there's the 'isComposting' property on the KeyboardEvent to find out if the user is currently using the IME

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...

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

#104
post #54

That's why I switched to American keyboard some time ago.

Same here. I use US International, which allows me to type the languages I speak. I even buy all my computers with US Keyboard layouts because I like when my keys match the OS configuration.

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

#106
post #63
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…

We all suffer from character blindness of some sort. For you: ` - that thing isn't formally defined in English either as far as I know. In English we don't have any diacritics. We do have a few extra symbols, beyond the alphabet for certain situations. Quotations ... " ... meh should be 66 99 and that will be fixed up by DTP software. We use ' to denote a dropped letter - abbreviation. There are a few others. I won't…

Note that ' is not technically a proper apostrophe which would be ’ instead. It only came to be thanks to typewriters having limited character space.

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

#107

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…

Yeah, I use EurKEY which gives me Ctrl+Alt+s for ß and has a lot of other Ctrl+Alt special characters but is otherwise a US Layout.

But I must say that most tools on Windows seem to handle it well with AltGr, only Ctrl+Alt is problematic.

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

#108

Earlier quoted context omitted.

For a 10-person startup, that's fair. For a company like Google , with offices in Germany and France and hundreds of engineers from any nationality, not so much. Other companies fall somewhere in between based on their headcount and global reach.

Big companies aren’t huge for the sake of being huge . They employ so many people because they have so much work to do. They still employ as few people as they can get away with.

Plus it's all about profit margins. Investing in tons of testing for not enough return from users means they just won't do that.

I'd imagine you'd need multi-lingual testers to use the product too, not just a native speaker given a foreign keyboard. There's no way to find bugs an average user would face with normal use.

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

#109

> For example if you have / as you shortcut for focusing the search field because your US users are accustomed to this behavior, just add alt+s as an alternative for international users. And Alt+S already opens the browser's History menu, on Firefox, and I'm not sure that applications can override this binding, or if users will appreciate it. ---- Last year, I was working on a Qt app that needed to translate physical…

Uhg, the keyboard zoom shortcut drives me bonkers sometimes. Most apps can't seem to make up their mind, or be bothered to implement both.

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

#110
post #2

It really surprised and disappointed me recently that native macOS apps have the same problem outlined here. For example, the standard system-wide ‘back’ shortcut (e.g. in Safari, Finder, Preview) is Cmd+[, but this is inoperable in many keyboard layouts that don’t have any key that produces [ without modifiers. (For context: I was writing a simple mouse gestures utility that sends that keyboard shortcut to accomplis…

Yeah Apple doesn't seem to even try to cater to non-US users with their shortcuts. That's the first I've heard of a system-wide back shortcut. You can't type that in my layout. The default switch between windows of a single app shortcut is also impossible, IIRC. One that I always have to reconfigure when I switch editors is the line comment shortcut which defaults usually to something like cmd-/.

I wonder if it's any better on iOS or are you just completely out of luck there when you can't reconfigure the shortcuts?

Post reply on HN