Atom confused by non-default keyboard layout and hijacks system keybinding
Opened this issue · 0 comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
(the FAQ link appears broken)
Description
On OSX, with the default keyboard layout, cmd + `
works to toggle between open Atom windows (it toggles between any open windows of the current application as a system keybinding). When switching from British (default) to British PC keyboard layout, which swaps the backquote and the backslash, Atom continues to view cmd + `
as cmd+\
and refuses to toggle between the atom windows.
Steps to Reproduce
- Switch keyboard on OSX from default British (similar to US) to British PC, swapping the backlash and backquote
- The
cmd + `
"toggle between windows of the same application" system keybinding stops working
Expected behavior:
I can continue to toggle between Atom windows
Actual behavior:
I completely lose the toggle between windows functionality, making atom a bit useless
Reproduces how often:
100% of time
Versions
Atom : 1.58.0
Electron: 9.4.4
Chrome : 83.0.4103.122
Node : 12.14.1
macOS Monterey
Version 12.1
Macbook Pro
Chip Apple M1 Pro
Additional Information
I tried setting both keybindings to unset in keymap.cson
but to no avail:
'.platform-darwin atom-text-editor .tree-view':
'cmd-\\': 'unset!',
'cmd-`': 'unset!'
'.platform-darwin':
'cmd-\\': 'unset!'
'cmd-`': 'unset!'
I also tried to unify how atom views the key using the init.coffee
script:
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'Backquote' and event.metaKey
return 'cmd-\\'
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'Backslash' and event.metaKey
return 'cmd-\\'
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'IntlBackslash' and event.metaKey
return 'cmd-\\'
Nothing works.
The key binding resolver shows atom recognises the keybinding as unset, but it won't give it up to the system one. I tried abort and native also, and none of them worked.
Ultimately, I don't care how this is resolved, whether by getting Atom to stop hijiacking the keybinding, or by setting the keybinding in atom (but I couldn't find that functionality).
I'm probably not seeing something obvious, but...
Update
Also tried setting
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'Backquote' and event.metaKey
return 'cmd-`'
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'Backslash' and event.metaKey
return 'cmd-`'
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.code is 'IntlBackslash' and event.metaKey
return 'cmd-`'
And removing stuff from keymap.cson
-- result is Atom keybinding resolver shows cmd + `
and no rules associated with it, but system behaviour still doesn't work.