atom/atom-keymap

Ctrl-Alt-[letter] keybinds don't work properly on ISO layout because of accented characters

Closed this issue · 9 comments

While using the ISO keyboard layout (on Windows - not sure whether this is an issue on other platforms), Ctrl-Alt-[letter] keybindings do not work properly sometimes, as ISO layout uses AltGr/Ctrl-Alt for accented characters, meaning that you cannot bind an action to something if it would produce an accented character, like for example Ctrl-Alt-O cannot be bound to because it resolves to ó - http://i.imgur.com/vSv4RgF.png. If I switch to US layout in the Windows settings, Ctrl-Alt keybindings work absolutely fine.

Steps to reproduce:
Switch the OS language in Windows to anything that is designed for the ISO layout - I used UK English to find this error, and try using a keybinding such as Ctrl-Alt-O - it should type ó into the text field, and not execute the action wanted.

This was deliberate. We had to take a stance on whether users should be allowed to enter accented characters regardless of shadowed bindings or be able to make certain bindings. Everyone seems to want something different.

The problem really is that with the current system the keybindings are based on the current layout. And if you use multiple layouts as @Gutawer159 does you have to define the keybindings twice. In this case once for Ctrl-Alt-O and once for ó. Which is a really big drawback of the current system. Also binding it to ó if you are using a ISO UK layout is really strange since it is not a common character in the UK. It is counter intuitive. The same problem applies on a Swedish layout where I would need µ instead of Ctrl-Alt-M.

If we change it so the typed character is ó but the keybinding resolver still resolves Ctrl-Alt-O we make defined keybindings overshadow accented characters? Which is also a drawback...

The current system has a rather naive assumption that the accented character is always preferred which is not always true. for example for the ISO UK layout...

So, from a naive way of view this appears to be the same issue I ran into:

Switching to Atom 1.12.x and disabling the "keyboard-localization" package rendered stuff like adding a project folder with the Ctrl-Alt-o completely impossible.

I am using win10 german standard QWERTZ key-layout.

For core keybindings they should be revamped to not include Ctrl-Alt- variants on Windows to not run in to this issue. If you want Ctrl-Alt-O to still add project folder then you need to rebind it in your keymap.cson.

Okay, this one works, but seems a little bit counter-intuitive to add a custom keybinding which basically appears (from a quick glance) the same as the core keybinding:
atom keybinding

Changing Ctrl-Alt- variants on Windows may also run into issues for keybindings just like Ctrl-Shift-o, which triggers application:open-folder.

@damieng I still think a project to remap our ctrl-alt- bindings on Windows is a good idea.

@damieng should we reopen this until after merging a PR that updates all the package key bindings.

Also, until we make a change to atom-keymap things still won't work even if we clear the bindings out of the way.