Cmd-\ (backslash) shortcut not working
Opened this issue · 1 comments
Previously attempted in #3. I'll try to gather some resources for possible future fix.
Note: the README could use the word "backslash" which it currently doesn't.
Learnings from today (26 Sep 2019)
- I thought it's a macOS / Apple issue but it's not:
Cmd-Shift-\
works in TextEdit. Cmd-\
also works in Firefox.- So it might be a Chrome / Chromium issue, I tried filing a bug report: https://crbug.com/1008333
- The Ukelele support thread was active today, I got some useful hints, see the messages around this one. For example this:
-
Other considerations:
It turns out that the name "keycode" is confusing.
Because that keycode 220 you mention is not concerned here. The keycode I mean is coming from the keyboard itself, before any processing by the computer.
It is 42 for the key next to the Enter key and 50 for the key right next to the left Shift key on ISO keyboards – independent of keyboard layout assignments. You can see those keycodes in Ukelele with the command "Edit Key…"So what you need to do is make the software believe you pressed key 50 when actually you have pressed key 42.
Or, in other words, to convert event.codes IntlBackslash + OSLeft into Backslash + OSLeft
-
- I tried how it behaves with Hotkey.js, a popular library for handling keyboard shortcuts in JavaScript. It didn't work so I opened an issue: jaywcjlove/hotkeys-js#114
- On https://keycode.info/, I get the key code 220 (correct) but
event.code
isIntlBackslash
instead ofBackslash
. It's the same in both Chrome and Firefox. - VSCode has a wiki entry on swapped
[Backquote]
and[IntlBackslash]
. Linked issue is this one, especially this comment: microsoft/vscode#26506 (comment)- This is also related: microsoft/vscode#24153