Live data from Hacker News

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

tkainrad.dev

11–20 of 212 posts

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

#11
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…

I'm Chilean and I use the ANSI US layout because /, are much easier to type than using ISO keyboards. When I need to type Spanish characters like áéíóú, ñ, etc. I switch to latin american ISO layout using WIN + Spacebar and then switch back.

Why not just use US Intl, and use ALT GR to produce á, é, í, ó, ú and ñ, along with æ, ø and å?

I have a strange ISO/ANSI US keyboard, with an ANSI left shift and an ISO enter key.

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

#12
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…

It‘s even worse on ISO keyboards (the ones with the large return key).

There‘s a physically different key arrangement on these, so even when switching to the US lay-out, some important system-wide shortcuts are still impossible to type (most notably the one for „switch to different window“).

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

#13
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…

Same problem with latin american keyboards found just a few kilometers south the US. If I remember correctly, the default modifier key in VIM is next to imposible to press on a l-a keyboard. It was ` ?

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

#14
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, "right-alt"+"s" is reported as "alt"+"control"+"s", which triggers crappy "control"+"s" checks.

Similar scenarios happen many places that check for 'alt'+'letter' without checking if control also is not pressed.

Microsoft thread for team user voice issues on this https://microsoftteams.uservoice.com/forums/555103-public/su...

or Medium's developer talking about 'ś' and 'ctrl'+'s'. https://medium.engineering/the-curious-case-of-disappearing-...

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

#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 comfortable way. Apple’s azerty layout is unique in this, as regular azerty puts those keys in a more sensible place. I keep wondering: why does apple make me do a Vulcan nerve pinch every time I want to index an array?

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

#16
post #11

Earlier quoted context omitted.

I'm Chilean and I use the ANSI US layout because /, are much easier to type than using ISO keyboards. When I need to type Spanish characters like áéíóú, ñ, etc. I switch to latin american ISO layout using WIN + Spacebar and then switch back.

Why not just use US Intl, and use ALT GR to produce á, é, í, ó, ú and ñ, along with æ, ø and å? I have a strange ISO/ANSI US keyboard, with an ANSI left shift and an ISO enter key.

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.

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

#17
post #11

Earlier quoted context omitted.

Why not just use US Intl, and use ALT GR to produce á, é, í, ó, ú and ñ, along with æ, ø and å? I have a strange ISO/ANSI US keyboard, with an ANSI left shift and an ISO enter key.

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.

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

#18

> What baffles me is that the problem exists in apps used by millions of people every day, developed by gigantic corporations who pride themselves with having the best engineers in the world. Why is this baffling? Because the underlying technical issues are rather trivial! > Hint for developers: Switch your computer’s keyboard layout to something other than US to debug your application’s shortcut handling on differen…

I agree to some extent. However, I have outlined a few very simple approaches. At the very least, developers could stop using special characters for their most important shortcut bindings.

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

#19

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…

Seems easy to fix

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

There’s your problem, right there

Post reply on HN