AltGR on swedish keyboard on macOS


#1

I have been trying on both Atom 1.14 and Atom Beta 1.15.0 and when on a mac with Swedish layout, the AltGr key is not honoured making shortcuts like “Fold current row”, alt + cmd + [ inaccessible. Instead it results in an outdent , cmd + [. The [ and ] on a Swedish layout is typed with alt (or altgr) + 8 or 9.
Is there a solution for this or one of the resisting quirks that are still unresolved when it comes to internationalised shortcuts?


#2

@Ben3eeE is this the kind of thing your new package was intended to solve?


#3

No. My package intended to solve the reverse problem. A keybinding causing you to be unable to write a character that is accessed using AltGraph.

Trying to jump in and help anyway:

I am a bit unfamiliar with the details of how macOS resolves keys but the mentioned keybinding and more are not accessible at all on Windows with a Swedish layout because they are bound to a keystroke that is impossible to type. On Windows we have to bind these commands to a different location. The åäö keys is a great place to put them.

@johnlamb
Possible solutions are:

  • Change the keybinding for these commands. I use the following to be able to access all commands:
'atom-workspace atom-text-editor:not([mini])':
  'ctrl-alt-ö': 'editor:fold-current-row'
  'ctrl-alt-ä': 'editor:unfold-current-row'
  'ctrl-å': 'editor:fold-all' # Atom Specific
  'ctrl-alt-å': 'editor:unfold-all' # Atom Specific
  'ctrl-alt-shift-ö': 'editor:fold-selection'

#4

This problem arise under Linux as well so the same as with windows, the keystrokes are impossible to type. Looks like macOS resolves altgr -> alt whereas linux resolves it to altgr but both (and I assume windows) can’t handle two alts at the same time.
I am guessing that means a custom keystroke resolver would be platform specific?
For now I’ll remap the commands I need with åäö, works crossplatform. Thanks.


#5

Yes, the custom keystroke resolver would be platform specific. Or one custom resolver that checks for current platform and acts accordingly.

It is also not possible to write a custom keystroke resolver to resolve this correctly on Windows because Windows does not have a dedicated AltGraph key. Ctrl-Alt is the same thing as AltGraph.