-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISO Keyboards: Backslash and IntlBackslash "swapped" #24153
Comments
@TomBurnettUK This might be an issue in our C++ node module that reads information about the current keyboard layout. Could you please:
I could then examine what the C++ node module determines for the |
Sure! Here's the file. |
Thanks to investigation help from @jrieken and his ISO keyboard, we were able to reproduce. The root problem is simple, our native C++ node module reads the scan codes -> chars mapping correctly, but Chromium decides to "swap" the Here is the offending code: int ISOKeyboardKeyCodeMap(int nativeKeyCode) {
// OS X will swap 'Backquote' and 'IntlBackslash' if it's an ISO keyboard.
// https://crbug.com/600607
switch (nativeKeyCode) {
case kVK_ISO_Section:
return kVK_ANSI_Grave;
case kVK_ANSI_Grave:
return kVK_ISO_Section;
default:
return nativeKeyCode;
}
}
DomCode DomCodeFromNSEvent(NSEvent* event) {
if (KBGetLayoutType(LMGetKbdType()) == kKeyboardISO) {
return ui::KeycodeConverter::NativeKeycodeToDomCode(
ISOKeyboardKeyCodeMap([event keyCode]));
}
return ui::KeycodeConverter::NativeKeycodeToDomCode([event keyCode]);
} We need to figure out a way on our side to "unswap" them... |
Whenever I try to use shortcuts which use the § and ` keys, their values appear to be reversed. The keys work correctly on every other app and everywhere else within VS Code; it's specifically when they're used as shortcuts. The problem extends to when I try to rebind them as well:
(Ignore the 'shift+command', they came from taking the screenshot!)
To be clear, the 'key' value is the correct one and the 'UI' value is the incorrect one the shortcut recognises.
The text was updated successfully, but these errors were encountered: