Live data from Hacker News

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

tkainrad.dev

171–180 of 212 posts

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

#171

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 would guess that the amount of people who care about which keyboard layout they use, don't use the local keyboard layout, and require appropriate labeling of keys (i.e. don't touch type) at the same time isn't that high. I can imagine how annoying it must be to be in that group, though.

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

#172

Earlier quoted context omitted.

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

If only it weren’t so damn expensive...

[deleted]

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

#173
post #82

Earlier quoted context omitted.

It's the grave accent - pretty rare in English outside of loan words from other languages. https://en.wikipedia.org/wiki/Grave_accent#English

Touché

I am not claiming to be a learnèd man, but I believe that is an acute accent, not a grave accent.

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

#174
post #167

Earlier quoted context omitted.

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

On Windows you can install a custom keyboard layout like https://github.com/umanovskis/win-kbd-usint-nodead/

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

#175

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…

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 personally find the Mac's use of command keys to be horrendous.

Taking a screenshot? Thats the claw handed Cmd+Shift+4 or maybe even Cmd+Ctrl+Shift+4. Why!? Triggering the emoji picker? Cmd+Ctrl+Space. Don't accidentally press Cmd+Option+Space or you get the world's most useless Finder window.

To make this worse, Apple sell a bunch of keyboards without the symbols printed on them. So often you have software telling you to press the ⌥, ^ and ⇧ keys when your keyboard doesn't even have labels for those symbols.

In contrast, Windows has the Windows key for interfacing with the OS and the Ctrl key for interfacing with apps. So much more logical.

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

#176

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…

ah, the Polish Alt-Right is a problem?

They have too much Control

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

#177
post #94
post #42

Earlier quoted context omitted.

It's not a windows thing. These are the codes that the hardware uses, on all platforms.

Nope. They're Windows ‘virtual key codes’, which are entirely unrelated to Windows ‘scan codes’, which are also not hardware codes (but are distantly descended from the original IBM PC). For instance, consider ‘/’ (beside right shift). The normal hardware code (USB HID) is page 7 usage 0x38 (sometimes written 0x070038; in theory HID usage codes can exceed 16 bits, but in practice they don't). The PS/2 hardware code (…

Thanks for the info, I wasn't aware. I thought it was all 'scancodes'

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

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

The standard behavior of Esc is to abort the current interaction - which is not the same as closing the dialog. For example, if you have a dialog with a drop-down list, and open that list, Esc should close it, not the whole dialog.

In this scenario, the "current interaction" is IME input. The bug is that the page intercepts Esc keypresses intended to be handled by it.

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

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

In intellij this was a bit frustrating to me, you can do ctrl-shift-`/` to block-comment (in german keyboard: ctrl+shift+shift+7). How do I double-shift?

I know you can configure that in IJ but I'm too lazy to do that, especially if there are many keys to remap.

So now I have a keyboard with UK Layout.

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

#180

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.

The British/Irish ISO layouts are reasonable. They are very close to the US layout, but gain the additional key.

I don’t think UK/ISO and US are close? Especially backquote between LShift and Z feels awkward if you’re used to ANSI.
Post reply on HN