atom / atom-keymap

Atom's selector-based keymap system
MIT License
105 stars 58 forks source link

Right-Alt (AltGr) key event interrupts matching a key sequence #126

Open fmthoma opened 8 years ago

fmthoma commented 8 years ago

Basically the same as #65: Pressing AltGr during a key sequence breaks the sequence.

I use vim-mode-plus and keyboard-localization with de_DE-neo keymap. With this configuration, the »delete inside double-quotes« key sequence (d i ") involves pressing AltGr + , for the typing the double-qoute. But immediately when I press the AltGr key after the i key, the search bar opens (AltGr + i is / in the neo2 layout), so the modifier is applied to the previous character, and the entire sequence evaluates to d / , instead of d i ".

I have confirmed that the problem remains when removing the vim-mode-plus and keyboard-localization packages: When I configure a keybinding for i " then the pending mode ends as soon as I press the AltGr key.

I realize that this issue is related to #35, but I would hope that this can be fixed independently.

fmthoma commented 8 years ago

Did a bit of debugging. Apparently the AltGr key is sent as keycode 225 (U+00E1) without modifiers. A breakpoint at keymap-manager.coffee:496 reveals that the keystroke is sent without any modifiers, so event.altKey and event.shiftKey are both false, and keystroke is á. This leads isAtomModifier to evaluate to false, and then the key is processed as part of the key sequence.

According to #35, the AltGr key is remapped to Ctrl + Alt later, but at this point it is not (yet) handled as a modifier.

MaxGyver83 commented 4 years ago

This problem seems still not to be fixed. I can observe a similar behavior in Atom 1.45.0 x64 with vim-mode-plus 1.36.4 using an (adapted) KOY keyboard layout (setxkbmap de koy) in Linux.

I can't even use the search in vim-mode-plus (/ = CapsLock+j in my layout, CapsLock is mapped to ISO_Level3_Shift).

@fmthoma : Have you found a workaround?

fmthoma commented 4 years ago

@MaxGyver83 No, I haven't found a solution or workaround, but I haven't been using Atom for quite some time either.

MaxGyver83 commented 4 years ago

@fmthoma Thanks for your answer! What do you use instead? It looks like Visual Studio Code and PyCharm work better when used with Neo or KOY + vim-mode.