atom / atom-keymap

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

Europatastatur gets identified as a non-latin layout #188

Closed georgd closed 7 years ago

georgd commented 8 years ago

This is Atom 1.12.5 on Win 7.

With this version keyboard shortcuts don’t work any longer as they should with german kb layout because they seem to be mapped to the position of the corresponding keys on an english kb.

Steps to reproduce:

Ben3eeE commented 8 years ago

Thanks for your report. I have a couple of questions.

georgd commented 8 years ago
Ben3eeE commented 8 years ago

Good morning @georgd

The reason I ask for changing layouts while Atom was running is because we have fixed a bug where we didn't identify layout switches correctly while Atom was running. The fix is on master and will go out in the next hotfix release. This bug have caused similar issues.


Now to your bug report:

Ben3eeE commented 8 years ago

An additional question:

georgd commented 8 years ago

Thank you, Linus, for looking into this.

Ben3eeE commented 8 years ago

@georgd WRT US layout and Europatastatur. I can reproduce the problem if I install this layout. As a workaround you can use Atom 1.12.4 or use the German (Germany) layout. You need to change the default input language in your operating system settings to use this layout in order for Atom to load correctly. I am sorry for the inconvenience.

@as-cii Something goes wrong when we build the layout for Europatastatur and the unmodified key for KeyS is incorrect causing Atom to believe that this is a non-latin layout. Maybe this is a bug in the Europatastatur layout?

From the latest commit in the 1.12-releases branch: image


@georgd WRT toggle-line-comments. Both Ctrl-/ and Ctrl-# will work. The second one originates from the menu accelerator which Electron incorrectly changes depending on current input language. For Swedish layout this changes to Ctrl-'.

georgd commented 8 years ago

When you say “You need to change the default input language in your operating system settings to use this layout in order for Atom to load correctly”, do you mean Europatastatur will then work?

Ben3eeE commented 8 years ago

Hey @georgd Europatastatur will not work in Atom 1.12.5 sorry if that was unclear.

georgd commented 8 years ago

OK, thank you!

as-cii commented 8 years ago

Thanks for the report, @georgd!

We have tracked down the cause of this issue. This behavior was supposed to be fixed by https://github.com/atom/keyboard-layout/pull/21, where we stopped processing dead keys when generating the keymap associated with the current keyboard layout.

Unfortunately, that doesn't prevent a dead key from passing through because MapVirtualKeyEx doesn't take into account keyboard modifiers. Specifically, the Europatastatur keyboard binds AltGr+KeyR to a dead key, so when evaluating it via ToUnicodeEx it will change the global keyboard buffer. Then, when evaluating KeyS, that buffer will be flushed and ToUnicodeEx will return an extra character (¨s), causing atom-keymap to recognize KeyS as non-latin.

We will post updates to this issue as soon as we release a fix for it.

georgd commented 8 years ago

Do I understand correctly, that Atom tests for the output of the sequence of the keys AltGr+R and s to determine if the layout is latin? If so should I test on Linux if the problem exists there too ?

as-cii commented 8 years ago

Do I understand correctly, that Atom tests for the output of the sequence of the keys AltGr+R and s to determine if the layout is latin?

Atom ensures that, when no modifiers keys are held down, A, S, D and F output latin characters. However it builds the entire keymap for all the keys available for the current keyboard (thus evaluating AltGrR too).

If so should I test on Linux if the problem exists there too ?

I think Linux is not affected by this issue, as it shouldn't modify the global keyboard buffer when converting key codes to characters.

eknoes commented 7 years ago

I think Linux is not affected by this issue, as it shouldn't modify the global keyboard buffer when converting key codes to characters.

I use Arch Linux with German Keyboard Layout, this bug affects me too!

winstliu commented 7 years ago

@eknoes Make sure you're installing from https://atom.io and not from the AUR.

Ben3eeE commented 7 years ago

@georgd Thank you for the report and apologies for the issue :bowing_man: The fix for this issue has been merged and will be available in Atom 1.18.