-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I have a QWERTZ keyboard and am unable to use the following default commands:
- Ctrl+Enter (Cmd+Enter on MacOS): Insert blank line
- Ctrl+[ (Cmd+[ on MacOS): Outdent line
- Ctrl+] (Cmd+] on MacOS): Indent line
- Ctrl+/ (Cmd+/ on MacOS): Toggle comment
- Shift+Alt+A: Toggle block comment
While the first four simply do not work (even when using the physical keys representing the keyCodes used in the source, probably because native features override them), the last one does add a block comment, but instead of the text it only contains the letter Å, so for example language: 'html', becomes /* Å */.
The first undo restores the original text, but commented out, the second undo removes the comment.
These issues are inherent to using KeyboardEvent.code / KeyboardEvent.keyCode instead of KeyboardEvent.key. Unfortunately, KeyboardEvent.key isn’t reliable as soon as the Shift- or Option-keys on Mac are involved, as that triggers different return values for KeyboardEvent.key, so I’m not quite sure how that could be fixed.
Unfortunately, I also couldn’t find an option to easily remap most of the default commands, as they’re added via a keydown listener, not via the keyCommandMap.