Closed georgd closed 7 years ago
Thanks for your report. I have a couple of questions.
atom --safe
?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:
I could not reproduce the issue where all keys shortcuts were identified as US layout when I started Atom 1.12.5 with the German (Germany) layout on Windows 7. I will install the "Europatastatur" later during the day to further test this.
The only reason editor:toggle-line-comments
is bound to Ctrl-# is because of a bug in electron. If you want to keep this shortcut for the future I recommend you bind it in your keymap.cson
file. As it will be removed when this bug is fixed. By default this is bound to Ctrl-/ which is Ctrl-Shift-7 for German layout.
'atom-text-editor:not([mini])':
'ctrl-#': 'editor:toggle-line-comments'
An additional question:
Thank you, Linus, for looking into this.
@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:
@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-'.
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?
Hey @georgd Europatastatur
will not work in Atom 1.12.5 sorry if that was unclear.
OK, thank you!
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.
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 ?
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.
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!
@eknoes Make sure you're installing from https://atom.io and not from the AUR.
@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.
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: