From 31da37a92785477d2ebe05de9b0da552a6dfb46a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 12 Oct 2021 14:19:21 +0200 Subject: [PATCH 1/9] Consolidate key code to electron label map --- src/vs/base/common/keyCodes.ts | 25 +++++++++++++++---- .../common/usLayoutResolvedKeybinding.ts | 13 +--------- .../common/macLinuxKeyboardMapper.ts | 14 +---------- .../common/windowsKeyboardMapper.ts | 14 +---------- 4 files changed, 23 insertions(+), 43 deletions(-) diff --git a/src/vs/base/common/keyCodes.ts b/src/vs/base/common/keyCodes.ts index 5dc94ce0324..2f2c71a4c08 100644 --- a/src/vs/base/common/keyCodes.ts +++ b/src/vs/base/common/keyCodes.ts @@ -228,13 +228,24 @@ class KeyCodeStrMap { const uiMap = new KeyCodeStrMap(); const userSettingsUSMap = new KeyCodeStrMap(); const userSettingsGeneralMap = new KeyCodeStrMap(); +const electronAcceleratorMap = new KeyCodeStrMap(); (function () { - function define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void { + function define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel?: string, generalUserSettingsLabel?: string, electronAcceleratorLabel?: string): void { + if (typeof usUserSettingsLabel === 'undefined') { + usUserSettingsLabel = uiLabel; + } + if (typeof generalUserSettingsLabel === 'undefined') { + generalUserSettingsLabel = usUserSettingsLabel; + } + if (typeof electronAcceleratorLabel === 'undefined') { + electronAcceleratorLabel = uiLabel; + } uiMap.define(keyCode, uiLabel); userSettingsUSMap.define(keyCode, usUserSettingsLabel); userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + electronAcceleratorMap.define(keyCode, electronAcceleratorLabel); } define(KeyCode.Unknown, 'unknown'); @@ -254,10 +265,10 @@ const userSettingsGeneralMap = new KeyCodeStrMap(); define(KeyCode.End, 'End'); define(KeyCode.Home, 'Home'); - define(KeyCode.LeftArrow, 'LeftArrow', 'Left'); - define(KeyCode.UpArrow, 'UpArrow', 'Up'); - define(KeyCode.RightArrow, 'RightArrow', 'Right'); - define(KeyCode.DownArrow, 'DownArrow', 'Down'); + define(KeyCode.LeftArrow, 'LeftArrow', 'Left', undefined, 'Left'); + define(KeyCode.UpArrow, 'UpArrow', 'Up', undefined, 'Up'); + define(KeyCode.RightArrow, 'RightArrow', 'Right', undefined, 'Right'); + define(KeyCode.DownArrow, 'DownArrow', 'Down', undefined, 'Down'); define(KeyCode.Insert, 'Insert'); define(KeyCode.Delete, 'Delete'); @@ -378,6 +389,10 @@ export namespace KeyCodeUtils { export function fromUserSettings(key: string): KeyCode { return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); } + + export function toElectronAccelerator(keyCode: KeyCode): string { + return electronAcceleratorMap.keyCodeToStr(keyCode); + } } /** diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index acb485ec6cb..471dd6d9072 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -52,18 +52,7 @@ export class USLayoutResolvedKeybinding extends BaseResolvedKeybinding Date: Tue, 12 Oct 2021 14:36:42 +0200 Subject: [PATCH 2/9] Clarify that why we cannot pass numpad keys to Electron --- src/vs/base/common/keyCodes.ts | 45 ++++++++++++------- .../common/baseResolvedKeybinding.ts | 2 +- .../common/usLayoutResolvedKeybinding.ts | 11 +---- .../common/macLinuxKeyboardMapper.ts | 13 +----- .../common/windowsKeyboardMapper.ts | 11 +---- 5 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/vs/base/common/keyCodes.ts b/src/vs/base/common/keyCodes.ts index 2f2c71a4c08..bfffb331f98 100644 --- a/src/vs/base/common/keyCodes.ts +++ b/src/vs/base/common/keyCodes.ts @@ -352,23 +352,23 @@ const electronAcceleratorMap = new KeyCodeStrMap(); define(KeyCode.OEM_8, 'OEM_8'); define(KeyCode.OEM_102, 'OEM_102'); - define(KeyCode.NUMPAD_0, 'NumPad0'); - define(KeyCode.NUMPAD_1, 'NumPad1'); - define(KeyCode.NUMPAD_2, 'NumPad2'); - define(KeyCode.NUMPAD_3, 'NumPad3'); - define(KeyCode.NUMPAD_4, 'NumPad4'); - define(KeyCode.NUMPAD_5, 'NumPad5'); - define(KeyCode.NUMPAD_6, 'NumPad6'); - define(KeyCode.NUMPAD_7, 'NumPad7'); - define(KeyCode.NUMPAD_8, 'NumPad8'); - define(KeyCode.NUMPAD_9, 'NumPad9'); + define(KeyCode.NUMPAD_0, 'NumPad0', undefined, undefined, 'num0'); + define(KeyCode.NUMPAD_1, 'NumPad1', undefined, undefined, 'num1'); + define(KeyCode.NUMPAD_2, 'NumPad2', undefined, undefined, 'num2'); + define(KeyCode.NUMPAD_3, 'NumPad3', undefined, undefined, 'num3'); + define(KeyCode.NUMPAD_4, 'NumPad4', undefined, undefined, 'num4'); + define(KeyCode.NUMPAD_5, 'NumPad5', undefined, undefined, 'num5'); + define(KeyCode.NUMPAD_6, 'NumPad6', undefined, undefined, 'num6'); + define(KeyCode.NUMPAD_7, 'NumPad7', undefined, undefined, 'num7'); + define(KeyCode.NUMPAD_8, 'NumPad8', undefined, undefined, 'num8'); + define(KeyCode.NUMPAD_9, 'NumPad9', undefined, undefined, 'num9'); - define(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply'); - define(KeyCode.NUMPAD_ADD, 'NumPad_Add'); - define(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator'); - define(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract'); - define(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal'); - define(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide'); + define(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply', undefined, undefined, 'nummult'); + define(KeyCode.NUMPAD_ADD, 'NumPad_Add', undefined, undefined, 'numadd'); + define(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator', undefined, undefined, 'numsep'); + define(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract', undefined, undefined, 'numsub'); + define(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal', undefined, undefined, 'numdec'); + define(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide', undefined, undefined, 'numdiv'); })(); @@ -390,7 +390,18 @@ export namespace KeyCodeUtils { return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); } - export function toElectronAccelerator(keyCode: KeyCode): string { + export function toElectronAccelerator(keyCode: KeyCode): string | null { + if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { + // [Electron Accelerators] Electron is able to parse numpad keys, but unfortunately it + // renders them just as regular keys in menus. For example, num0 is rendered as "0", + // numdiv is rendered as "/", numsub is rendered as "-". + // + // This can lead to incredible confusion, as it makes numpad based keybindings indistinguishable + // from keybindings based on regular keys. + // + // We therefore need to fall back to custom rendering for numpad keys. + return null; + } return electronAcceleratorMap.keyCodeToStr(keyCode); } } diff --git a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts index 9b9ce33d972..c178254f0d2 100644 --- a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts @@ -32,7 +32,7 @@ export abstract class BaseResolvedKeybinding extends Resolv public getElectronAccelerator(): string | null { if (this._parts.length > 1) { - // Electron cannot handle chords + // [Electron Accelerators] Electron cannot handle chords return null; } return ElectronAcceleratorLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getElectronAccelerator(keybinding)); diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index 471dd6d9072..6499304c7a1 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -46,20 +46,11 @@ export class USLayoutResolvedKeybinding extends BaseResolvedKeybinding= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { - // Electron cannot handle numpad keys - return null; - } - - return KeyCodeUtils.toElectronAccelerator(keyCode); - } - protected _getElectronAccelerator(keybinding: SimpleKeybinding): string | null { if (keybinding.isDuplicateModifierCase()) { return null; } - return this._keyCodeToElectronAccelerator(keybinding.keyCode); + return KeyCodeUtils.toElectronAccelerator(keybinding.keyCode); } protected _getUserSettingsLabel(keybinding: SimpleKeybinding): string | null { diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index 6759eeb17c9..357f2651542 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -872,15 +872,6 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { return this._scanCodeToDispatch[binding.scanCode]; } - private _getElectronLabelForKeyCode(keyCode: KeyCode): string | null { - if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { - // Electron cannot handle numpad keys - return null; - } - - return KeyCodeUtils.toElectronAccelerator(keyCode); - } - public getElectronAcceleratorLabelForScanCodeBinding(binding: ScanCodeBinding | null): string | null { if (!binding) { return null; @@ -891,7 +882,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode]; if (immutableKeyCode !== KeyCode.DependsOnKbLayout) { - return this._getElectronLabelForKeyCode(immutableKeyCode); + return KeyCodeUtils.toElectronAccelerator(immutableKeyCode); } // Check if this scanCode always maps to the same keyCode and back @@ -924,7 +915,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { } if (constantKeyCode !== KeyCode.DependsOnKbLayout) { - return this._getElectronLabelForKeyCode(constantKeyCode); + return KeyCodeUtils.toElectronAccelerator(constantKeyCode); } return null; diff --git a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts index c6af895d5fa..72af09846b1 100644 --- a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts @@ -427,16 +427,7 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { return null; } } - return this._keyCodeToElectronAccelerator(keybinding.keyCode); - } - - private _keyCodeToElectronAccelerator(keyCode: KeyCode): string | null { - if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { - // Electron cannot handle numpad keys - return null; - } - - return KeyCodeUtils.toElectronAccelerator(keyCode); + return KeyCodeUtils.toElectronAccelerator(keybinding.keyCode); } private _getLabelForKeyCode(keyCode: KeyCode): string { From ea91d365aa92f123ea87097063bf236e3569c196 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 12 Oct 2021 14:46:56 +0200 Subject: [PATCH 3/9] Move Electron duplicate modifier check to `BaseResolvedKeybinding` --- src/vs/base/common/keyCodes.ts | 13 ++++++++++++- src/vs/base/common/keybindingLabels.ts | 8 +------- src/vs/base/common/scanCode.ts | 4 ++-- .../keybinding/common/baseResolvedKeybinding.ts | 11 ++++++++--- .../keybinding/common/usLayoutResolvedKeybinding.ts | 3 --- .../keybinding/common/macLinuxKeyboardMapper.ts | 3 --- .../keybinding/common/windowsKeyboardMapper.ts | 3 --- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/vs/base/common/keyCodes.ts b/src/vs/base/common/keyCodes.ts index bfffb331f98..87423c4c0ca 100644 --- a/src/vs/base/common/keyCodes.ts +++ b/src/vs/base/common/keyCodes.ts @@ -468,7 +468,18 @@ export function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); } -export class SimpleKeybinding { +export interface Modifiers { + readonly ctrlKey: boolean; + readonly shiftKey: boolean; + readonly altKey: boolean; + readonly metaKey: boolean; +} + +export interface IBaseKeybinding extends Modifiers { + isDuplicateModifierCase(): boolean; +} + +export class SimpleKeybinding implements IBaseKeybinding { public readonly ctrlKey: boolean; public readonly shiftKey: boolean; public readonly altKey: boolean; diff --git a/src/vs/base/common/keybindingLabels.ts b/src/vs/base/common/keybindingLabels.ts index 2c36c13d7aa..1ee066014f2 100644 --- a/src/vs/base/common/keybindingLabels.ts +++ b/src/vs/base/common/keybindingLabels.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { Modifiers } from 'vs/base/common/keyCodes'; import { OperatingSystem } from 'vs/base/common/platform'; import * as nls from 'vs/nls'; @@ -14,13 +15,6 @@ export interface ModifierLabels { readonly separator: string; } -export interface Modifiers { - readonly ctrlKey: boolean; - readonly shiftKey: boolean; - readonly altKey: boolean; - readonly metaKey: boolean; -} - export interface KeyLabelProvider { (keybinding: T): string | null; } diff --git a/src/vs/base/common/scanCode.ts b/src/vs/base/common/scanCode.ts index b0547e05bd4..15738143416 100644 --- a/src/vs/base/common/scanCode.ts +++ b/src/vs/base/common/scanCode.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { KeyCode } from 'vs/base/common/keyCodes'; +import { IBaseKeybinding, KeyCode } from 'vs/base/common/keyCodes'; /** * keyboardEvent.code @@ -228,7 +228,7 @@ export const IMMUTABLE_CODE_TO_KEY_CODE: KeyCode[] = []; */ export const IMMUTABLE_KEY_CODE_TO_CODE: ScanCode[] = []; -export class ScanCodeBinding { +export class ScanCodeBinding implements IBaseKeybinding { public readonly ctrlKey: boolean; public readonly shiftKey: boolean; public readonly altKey: boolean; diff --git a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts index c178254f0d2..4f4b8ba910a 100644 --- a/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/baseResolvedKeybinding.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { illegalArgument } from 'vs/base/common/errors'; -import { AriaLabelProvider, ElectronAcceleratorLabelProvider, Modifiers, UILabelProvider, UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; -import { KeybindingModifier, ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; +import { AriaLabelProvider, ElectronAcceleratorLabelProvider, UILabelProvider, UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; +import { IBaseKeybinding, KeybindingModifier, ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { OperatingSystem } from 'vs/base/common/platform'; -export abstract class BaseResolvedKeybinding extends ResolvedKeybinding { +export abstract class BaseResolvedKeybinding extends ResolvedKeybinding { protected readonly _os: OperatingSystem; protected readonly _parts: T[]; @@ -35,6 +35,11 @@ export abstract class BaseResolvedKeybinding extends Resolv // [Electron Accelerators] Electron cannot handle chords return null; } + if (this._parts[0].isDuplicateModifierCase()) { + // [Electron Accelerators] Electron cannot handle modifier only keybindings + // e.g. "shift shift" + return null; + } return ElectronAcceleratorLabelProvider.toLabel(this._os, this._parts, (keybinding) => this._getElectronAccelerator(keybinding)); } diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index 6499304c7a1..1b0d5744833 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -47,9 +47,6 @@ export class USLayoutResolvedKeybinding extends BaseResolvedKeybinding Date: Tue, 12 Oct 2021 15:13:12 +0200 Subject: [PATCH 4/9] Non US keyboard layouts: pass OEM keys as electron accelerators --- .../common/macLinuxKeyboardMapper.ts | 20 --- .../test/electron-browser/linux_de_ch.txt | 16 +- .../test/electron-browser/linux_en_uk.txt | 160 +++++++++--------- .../test/electron-browser/linux_ru.txt | 32 ++-- .../macLinuxKeyboardMapper.test.ts | 4 +- .../test/electron-browser/mac_de_ch.txt | 12 +- .../test/electron-browser/mac_zh_hant.txt | 16 +- 7 files changed, 120 insertions(+), 140 deletions(-) diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index 46fbfcb14dc..941d1308e98 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -885,26 +885,6 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { // Check if this scanCode always maps to the same keyCode and back const constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode); - if (!this._isUSStandard) { - // Electron cannot handle these key codes on anything else than standard US - const isOEMKey = ( - constantKeyCode === KeyCode.US_SEMICOLON - || constantKeyCode === KeyCode.US_EQUAL - || constantKeyCode === KeyCode.US_COMMA - || constantKeyCode === KeyCode.US_MINUS - || constantKeyCode === KeyCode.US_DOT - || constantKeyCode === KeyCode.US_SLASH - || constantKeyCode === KeyCode.US_BACKTICK - || constantKeyCode === KeyCode.US_OPEN_SQUARE_BRACKET - || constantKeyCode === KeyCode.US_BACKSLASH - || constantKeyCode === KeyCode.US_CLOSE_SQUARE_BRACKET - ); - - if (isOEMKey) { - return null; - } - } - // See https://github.com/microsoft/vscode/issues/108880 if (this._OS === OperatingSystem.Macintosh && binding.ctrlKey && !binding.metaKey && !binding.altKey && constantKeyCode === KeyCode.US_MINUS) { // ctrl+- and ctrl+shift+- render very similarly in native macOS menus, leading to confusion diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt index aaf9263ec26..1c73671253d 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt @@ -469,14 +469,14 @@ isUSStandard: false | Shift+Alt+Period | : | Shift+Alt+; | | Shift+Alt+. | shift+alt+[Period] | null | shift+alt+[Period] | NO | | Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | null | ctrl+shift+alt+[Period] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Slash | - | - | | - | - | null | [Slash] | | -| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Slash] | | -| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | null | shift+[Slash] | | -| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Slash] | | -| Alt+Slash | - | Alt+- | | Alt+- | alt+- | null | alt+[Slash] | | -| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | null | ctrl+alt+[Slash] | | -| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Slash] | | -| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Slash] | | +| Slash | - | - | | - | - | - | [Slash] | | +| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Slash] | | +| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Slash] | | +| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Slash] | | +| Alt+Slash | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Slash] | | +| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Slash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt index 9d1ab7184c4..e798186a3c0 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt @@ -354,41 +354,41 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Minus | - | - | | - | - | null | [Minus] | | -| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | -| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | null | shift+[Minus] | | -| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | -| Alt+Minus | - | Alt+- | | Alt+- | alt+- | null | alt+[Minus] | | -| Ctrl+Alt+Minus | \ | \ | 1 | Ctrl+Alt+- | ctrl+alt+[Minus] | null | ctrl+alt+[Minus] | NO | -| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Minus] | | -| Ctrl+Shift+Alt+Minus | ¿ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Minus] | | +| Minus | - | - | | - | - | - | [Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Minus] | | +| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Minus] | | +| Alt+Minus | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Minus] | | +| Ctrl+Alt+Minus | \ | \ | 1 | Ctrl+Alt+- | ctrl+alt+[Minus] | Ctrl+Alt+- | ctrl+alt+[Minus] | NO | +| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Minus] | | +| Ctrl+Shift+Alt+Minus | ¿ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Minus] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Equal | = | = | | = | = | null | [Equal] | | -| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | -| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | -| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | -| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | -| Ctrl+Alt+Equal | U+327 | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | -| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | -| Ctrl+Shift+Alt+Equal | U+328 | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | +| Equal | = | = | | = | = | = | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | Ctrl+= | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | Shift+= | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | Ctrl+Shift+= | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | Alt+= | alt+[Equal] | | +| Ctrl+Alt+Equal | U+327 | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | Ctrl+Alt+= | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | Shift+Alt+= | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | U+328 | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+[Equal] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| BracketLeft | [ | [ | 1 | [ | [ | null | [BracketLeft] | | -| Ctrl+BracketLeft | [ | Ctrl+[ | | Ctrl+[ | ctrl+[ | null | ctrl+[BracketLeft] | | -| Shift+BracketLeft | { | Shift+[ | 1 | Shift+[ | shift+[ | null | shift+[BracketLeft] | | -| Ctrl+Shift+BracketLeft | { | Ctrl+Shift+[ | | Ctrl+Shift+[ | ctrl+shift+[ | null | ctrl+shift+[BracketLeft] | | -| Alt+BracketLeft | [ | Alt+[ | | Alt+[ | alt+[ | null | alt+[BracketLeft] | | -| Ctrl+Alt+BracketLeft | ¨ | Ctrl+Alt+[ | | Ctrl+Alt+[ | ctrl+alt+[ | null | ctrl+alt+[BracketLeft] | | -| Shift+Alt+BracketLeft | { | Shift+Alt+[ | | Shift+Alt+[ | shift+alt+[ | null | shift+alt+[BracketLeft] | | -| Ctrl+Shift+Alt+BracketLeft | ˚ | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | null | ctrl+shift+alt+[BracketLeft] | | +| BracketLeft | [ | [ | 1 | [ | [ | [ | [BracketLeft] | | +| Ctrl+BracketLeft | [ | Ctrl+[ | | Ctrl+[ | ctrl+[ | Ctrl+[ | ctrl+[BracketLeft] | | +| Shift+BracketLeft | { | Shift+[ | 1 | Shift+[ | shift+[ | Shift+[ | shift+[BracketLeft] | | +| Ctrl+Shift+BracketLeft | { | Ctrl+Shift+[ | | Ctrl+Shift+[ | ctrl+shift+[ | Ctrl+Shift+[ | ctrl+shift+[BracketLeft] | | +| Alt+BracketLeft | [ | Alt+[ | | Alt+[ | alt+[ | Alt+[ | alt+[BracketLeft] | | +| Ctrl+Alt+BracketLeft | ¨ | Ctrl+Alt+[ | | Ctrl+Alt+[ | ctrl+alt+[ | Ctrl+Alt+[ | ctrl+alt+[BracketLeft] | | +| Shift+Alt+BracketLeft | { | Shift+Alt+[ | | Shift+Alt+[ | shift+alt+[ | Shift+Alt+[ | shift+alt+[BracketLeft] | | +| Ctrl+Shift+Alt+BracketLeft | ˚ | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[BracketLeft] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| BracketRight | ] | ] | 1 | ] | ] | null | [BracketRight] | | -| Ctrl+BracketRight | ] | Ctrl+] | | Ctrl+] | ctrl+] | null | ctrl+[BracketRight] | | -| Shift+BracketRight | } | Shift+] | 1 | Shift+] | shift+] | null | shift+[BracketRight] | | -| Ctrl+Shift+BracketRight | } | Ctrl+Shift+] | | Ctrl+Shift+] | ctrl+shift+] | null | ctrl+shift+[BracketRight] | | -| Alt+BracketRight | ] | Alt+] | | Alt+] | alt+] | null | alt+[BracketRight] | | -| Ctrl+Alt+BracketRight | ˜ | Ctrl+Alt+] | | Ctrl+Alt+] | ctrl+alt+] | null | ctrl+alt+[BracketRight] | | -| Shift+Alt+BracketRight | } | Shift+Alt+] | | Shift+Alt+] | shift+alt+] | null | shift+alt+[BracketRight] | | -| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | null | ctrl+shift+alt+[BracketRight] | | +| BracketRight | ] | ] | 1 | ] | ] | ] | [BracketRight] | | +| Ctrl+BracketRight | ] | Ctrl+] | | Ctrl+] | ctrl+] | Ctrl+] | ctrl+[BracketRight] | | +| Shift+BracketRight | } | Shift+] | 1 | Shift+] | shift+] | Shift+] | shift+[BracketRight] | | +| Ctrl+Shift+BracketRight | } | Ctrl+Shift+] | | Ctrl+Shift+] | ctrl+shift+] | Ctrl+Shift+] | ctrl+shift+[BracketRight] | | +| Alt+BracketRight | ] | Alt+] | | Alt+] | alt+] | Alt+] | alt+[BracketRight] | | +| Ctrl+Alt+BracketRight | ˜ | Ctrl+Alt+] | | Ctrl+Alt+] | ctrl+alt+] | Ctrl+Alt+] | ctrl+alt+[BracketRight] | | +| Shift+Alt+BracketRight | } | Shift+Alt+] | | Shift+Alt+] | shift+alt+] | Shift+Alt+] | shift+alt+[BracketRight] | | +| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | Ctrl+Shift+Alt+] | ctrl+shift+alt+[BracketRight] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -410,14 +410,14 @@ isUSStandard: false | Shift+Alt+IntlHash | --- | | | null | null | null | null | | | Ctrl+Shift+Alt+IntlHash | --- | | | null | null | null | null | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Semicolon | ; | ; | | ; | ; | null | [Semicolon] | | -| Ctrl+Semicolon | ; | Ctrl+; | | Ctrl+; | ctrl+; | null | ctrl+[Semicolon] | | -| Shift+Semicolon | : | Shift+; | | Shift+; | shift+; | null | shift+[Semicolon] | | -| Ctrl+Shift+Semicolon | : | Ctrl+Shift+; | | Ctrl+Shift+; | ctrl+shift+; | null | ctrl+shift+[Semicolon] | | -| Alt+Semicolon | ; | Alt+; | | Alt+; | alt+; | null | alt+[Semicolon] | | -| Ctrl+Alt+Semicolon | ´ | Ctrl+Alt+; | | Ctrl+Alt+; | ctrl+alt+; | null | ctrl+alt+[Semicolon] | | -| Shift+Alt+Semicolon | : | Shift+Alt+; | | Shift+Alt+; | shift+alt+; | null | shift+alt+[Semicolon] | | -| Ctrl+Shift+Alt+Semicolon | ˝ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | null | ctrl+shift+alt+[Semicolon] | | +| Semicolon | ; | ; | | ; | ; | ; | [Semicolon] | | +| Ctrl+Semicolon | ; | Ctrl+; | | Ctrl+; | ctrl+; | Ctrl+; | ctrl+[Semicolon] | | +| Shift+Semicolon | : | Shift+; | | Shift+; | shift+; | Shift+; | shift+[Semicolon] | | +| Ctrl+Shift+Semicolon | : | Ctrl+Shift+; | | Ctrl+Shift+; | ctrl+shift+; | Ctrl+Shift+; | ctrl+shift+[Semicolon] | | +| Alt+Semicolon | ; | Alt+; | | Alt+; | alt+; | Alt+; | alt+[Semicolon] | | +| Ctrl+Alt+Semicolon | ´ | Ctrl+Alt+; | | Ctrl+Alt+; | ctrl+alt+; | Ctrl+Alt+; | ctrl+alt+[Semicolon] | | +| Shift+Alt+Semicolon | : | Shift+Alt+; | | Shift+Alt+; | shift+alt+; | Shift+Alt+; | shift+alt+[Semicolon] | | +| Ctrl+Shift+Alt+Semicolon | ˝ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | Ctrl+Shift+Alt+; | ctrl+shift+alt+[Semicolon] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Quote | ' | ' | | ' | ' | ' | [Quote] | | | Ctrl+Quote | ' | Ctrl+' | | Ctrl+' | ctrl+' | Ctrl+' | ctrl+[Quote] | | @@ -430,41 +430,41 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Backquote | ` | ` | 1 | ` | ` | null | [Backquote] | | -| Ctrl+Backquote | ` | Ctrl+` | | Ctrl+` | ctrl+` | null | ctrl+[Backquote] | | -| Shift+Backquote | ¬ | Shift+` | 1 | Shift+` | shift+` | null | shift+[Backquote] | | -| Ctrl+Shift+Backquote | ¬ | Ctrl+Shift+` | 1 | Ctrl+Shift+` | ctrl+shift+` | null | ctrl+shift+[Backquote] | | -| Alt+Backquote | ` | Alt+` | | Alt+` | alt+` | null | alt+[Backquote] | | -| Ctrl+Alt+Backquote | | | Shift+\ | 1 | Ctrl+Alt+` | ctrl+alt+[Backquote] | null | ctrl+alt+[Backquote] | NO | -| Shift+Alt+Backquote | ¬ | Shift+Alt+` | 1 | Shift+Alt+` | shift+alt+` | null | shift+alt+[Backquote] | | -| Ctrl+Shift+Alt+Backquote | | | Ctrl+Shift+Alt+` | 1 | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | null | ctrl+shift+alt+[Backquote] | | +| Backquote | ` | ` | 1 | ` | ` | ` | [Backquote] | | +| Ctrl+Backquote | ` | Ctrl+` | | Ctrl+` | ctrl+` | Ctrl+` | ctrl+[Backquote] | | +| Shift+Backquote | ¬ | Shift+` | 1 | Shift+` | shift+` | Shift+` | shift+[Backquote] | | +| Ctrl+Shift+Backquote | ¬ | Ctrl+Shift+` | 1 | Ctrl+Shift+` | ctrl+shift+` | Ctrl+Shift+` | ctrl+shift+[Backquote] | | +| Alt+Backquote | ` | Alt+` | | Alt+` | alt+` | Alt+` | alt+[Backquote] | | +| Ctrl+Alt+Backquote | | | Shift+\ | 1 | Ctrl+Alt+` | ctrl+alt+[Backquote] | Ctrl+Alt+` | ctrl+alt+[Backquote] | NO | +| Shift+Alt+Backquote | ¬ | Shift+Alt+` | 1 | Shift+Alt+` | shift+alt+` | Shift+Alt+` | shift+alt+[Backquote] | | +| Ctrl+Shift+Alt+Backquote | | | Ctrl+Shift+Alt+` | 1 | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | Ctrl+Shift+Alt+` | ctrl+shift+alt+[Backquote] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Comma | , | , | | , | , | null | [Comma] | | -| Ctrl+Comma | , | Ctrl+, | | Ctrl+, | ctrl+, | null | ctrl+[Comma] | | -| Shift+Comma | < | Shift+, | 1 | Shift+, | shift+, | null | shift+[Comma] | | -| Ctrl+Shift+Comma | < | Ctrl+Shift+, | | Ctrl+Shift+, | ctrl+shift+, | null | ctrl+shift+[Comma] | | -| Alt+Comma | , | Alt+, | | Alt+, | alt+, | null | alt+[Comma] | | -| Ctrl+Alt+Comma | ─ | Ctrl+Alt+, | | Ctrl+Alt+, | ctrl+alt+, | null | ctrl+alt+[Comma] | | -| Shift+Alt+Comma | < | Shift+Alt+, | | Shift+Alt+, | shift+alt+, | null | shift+alt+[Comma] | | -| Ctrl+Shift+Alt+Comma | × | Ctrl+Shift+Alt+, | | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | null | ctrl+shift+alt+[Comma] | | +| Comma | , | , | | , | , | , | [Comma] | | +| Ctrl+Comma | , | Ctrl+, | | Ctrl+, | ctrl+, | Ctrl+, | ctrl+[Comma] | | +| Shift+Comma | < | Shift+, | 1 | Shift+, | shift+, | Shift+, | shift+[Comma] | | +| Ctrl+Shift+Comma | < | Ctrl+Shift+, | | Ctrl+Shift+, | ctrl+shift+, | Ctrl+Shift+, | ctrl+shift+[Comma] | | +| Alt+Comma | , | Alt+, | | Alt+, | alt+, | Alt+, | alt+[Comma] | | +| Ctrl+Alt+Comma | ─ | Ctrl+Alt+, | | Ctrl+Alt+, | ctrl+alt+, | Ctrl+Alt+, | ctrl+alt+[Comma] | | +| Shift+Alt+Comma | < | Shift+Alt+, | | Shift+Alt+, | shift+alt+, | Shift+Alt+, | shift+alt+[Comma] | | +| Ctrl+Shift+Alt+Comma | × | Ctrl+Shift+Alt+, | | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | Ctrl+Shift+Alt+, | ctrl+shift+alt+[Comma] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Period | . | . | | . | . | null | [Period] | | -| Ctrl+Period | . | Ctrl+. | | Ctrl+. | ctrl+. | null | ctrl+[Period] | | -| Shift+Period | > | Shift+. | 1 | Shift+. | shift+. | null | shift+[Period] | | -| Ctrl+Shift+Period | > | Ctrl+Shift+. | | Ctrl+Shift+. | ctrl+shift+. | null | ctrl+shift+[Period] | | -| Alt+Period | . | Alt+. | | Alt+. | alt+. | null | alt+[Period] | | -| Ctrl+Alt+Period | · | Ctrl+Alt+. | | Ctrl+Alt+. | ctrl+alt+. | null | ctrl+alt+[Period] | | -| Shift+Alt+Period | > | Shift+Alt+. | | Shift+Alt+. | shift+alt+. | null | shift+alt+[Period] | | -| Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | null | ctrl+shift+alt+[Period] | | +| Period | . | . | | . | . | . | [Period] | | +| Ctrl+Period | . | Ctrl+. | | Ctrl+. | ctrl+. | Ctrl+. | ctrl+[Period] | | +| Shift+Period | > | Shift+. | 1 | Shift+. | shift+. | Shift+. | shift+[Period] | | +| Ctrl+Shift+Period | > | Ctrl+Shift+. | | Ctrl+Shift+. | ctrl+shift+. | Ctrl+Shift+. | ctrl+shift+[Period] | | +| Alt+Period | . | Alt+. | | Alt+. | alt+. | Alt+. | alt+[Period] | | +| Ctrl+Alt+Period | · | Ctrl+Alt+. | | Ctrl+Alt+. | ctrl+alt+. | Ctrl+Alt+. | ctrl+alt+[Period] | | +| Shift+Alt+Period | > | Shift+Alt+. | | Shift+Alt+. | shift+alt+. | Shift+Alt+. | shift+alt+[Period] | | +| Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Slash | / | / | | / | / | null | [Slash] | | -| Ctrl+Slash | / | Ctrl+/ | | Ctrl+/ | ctrl+/ | null | ctrl+[Slash] | | -| Shift+Slash | ? | Shift+/ | | Shift+/ | shift+/ | null | shift+[Slash] | | -| Ctrl+Shift+Slash | ? | Ctrl+Shift+/ | | Ctrl+Shift+/ | ctrl+shift+/ | null | ctrl+shift+[Slash] | | -| Alt+Slash | / | Alt+/ | | Alt+/ | alt+/ | null | alt+[Slash] | | -| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+/ | | Ctrl+Alt+/ | ctrl+alt+/ | null | ctrl+alt+[Slash] | | -| Shift+Alt+Slash | ? | Shift+Alt+/ | | Shift+Alt+/ | shift+alt+/ | null | shift+alt+[Slash] | | -| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+/ | | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | null | ctrl+shift+alt+[Slash] | | +| Slash | / | / | | / | / | / | [Slash] | | +| Ctrl+Slash | / | Ctrl+/ | | Ctrl+/ | ctrl+/ | Ctrl+/ | ctrl+[Slash] | | +| Shift+Slash | ? | Shift+/ | | Shift+/ | shift+/ | Shift+/ | shift+[Slash] | | +| Ctrl+Shift+Slash | ? | Ctrl+Shift+/ | | Ctrl+Shift+/ | ctrl+shift+/ | Ctrl+Shift+/ | ctrl+shift+[Slash] | | +| Alt+Slash | / | Alt+/ | | Alt+/ | alt+/ | Alt+/ | alt+[Slash] | | +| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+/ | | Ctrl+Alt+/ | ctrl+alt+/ | Ctrl+Alt+/ | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | ? | Shift+Alt+/ | | Shift+Alt+/ | shift+alt+/ | Shift+Alt+/ | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+/ | | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | Ctrl+Shift+Alt+/ | ctrl+shift+alt+[Slash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -486,14 +486,14 @@ isUSStandard: false | Shift+Alt+Numpad0 | --- | Shift+Alt+NumPad0 | | Shift+Alt+NumPad0 | shift+alt+numpad0 | null | shift+alt+[Numpad0] | | | Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | null | ctrl+shift+alt+[Numpad0] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| IntlBackslash | \ | \ | 2 | \ | \ | null | [IntlBackslash] | | -| Ctrl+IntlBackslash | \ | Ctrl+\ | | Ctrl+\ | ctrl+\ | null | ctrl+[IntlBackslash] | | -| Shift+IntlBackslash | | | Shift+\ | 2 | Shift+\ | shift+\ | null | shift+[IntlBackslash] | | -| Ctrl+Shift+IntlBackslash | | | Ctrl+Shift+\ | | Ctrl+Shift+\ | ctrl+shift+\ | null | ctrl+shift+[IntlBackslash] | | -| Alt+IntlBackslash | \ | Alt+\ | | Alt+\ | alt+\ | null | alt+[IntlBackslash] | | -| Ctrl+Alt+IntlBackslash | | | Ctrl+Alt+\ | | Ctrl+Alt+\ | ctrl+alt+\ | null | ctrl+alt+[IntlBackslash] | | -| Shift+Alt+IntlBackslash | | | Shift+Alt+\ | | Shift+Alt+\ | shift+alt+\ | null | shift+alt+[IntlBackslash] | | -| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | null | ctrl+shift+alt+[IntlBackslash] | | +| IntlBackslash | \ | \ | 2 | \ | \ | \ | [IntlBackslash] | | +| Ctrl+IntlBackslash | \ | Ctrl+\ | | Ctrl+\ | ctrl+\ | Ctrl+\ | ctrl+[IntlBackslash] | | +| Shift+IntlBackslash | | | Shift+\ | 2 | Shift+\ | shift+\ | Shift+\ | shift+[IntlBackslash] | | +| Ctrl+Shift+IntlBackslash | | | Ctrl+Shift+\ | | Ctrl+Shift+\ | ctrl+shift+\ | Ctrl+Shift+\ | ctrl+shift+[IntlBackslash] | | +| Alt+IntlBackslash | \ | Alt+\ | | Alt+\ | alt+\ | Alt+\ | alt+[IntlBackslash] | | +| Ctrl+Alt+IntlBackslash | | | Ctrl+Alt+\ | | Ctrl+Alt+\ | ctrl+alt+\ | Ctrl+Alt+\ | ctrl+alt+[IntlBackslash] | | +| Shift+Alt+IntlBackslash | | | Shift+Alt+\ | | Shift+Alt+\ | shift+alt+\ | Shift+Alt+\ | shift+alt+[IntlBackslash] | | +| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | Ctrl+Shift+Alt+\ | ctrl+shift+alt+[IntlBackslash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | IntlRo | --- | | | null | [IntlRo] | null | [IntlRo] | NO | | Ctrl+IntlRo | --- | | | null | ctrl+[IntlRo] | null | ctrl+[IntlRo] | NO | diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt index 389681ee995..7179276ad1d 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt @@ -360,23 +360,23 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Minus | - | - | | - | - | null | [Minus] | | -| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | -| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | null | shift+[Minus] | | -| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | -| Alt+Minus | - | Alt+- | | Alt+- | alt+- | null | alt+[Minus] | | -| Ctrl+Alt+Minus | - | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | null | ctrl+alt+[Minus] | | -| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Minus] | | -| Ctrl+Shift+Alt+Minus | _ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Minus] | | +| Minus | - | - | | - | - | - | [Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Minus] | | +| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Minus] | | +| Alt+Minus | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Minus] | | +| Ctrl+Alt+Minus | - | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Minus] | | +| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Minus] | | +| Ctrl+Shift+Alt+Minus | _ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Minus] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Equal | = | = | | = | = | null | [Equal] | | -| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | -| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | -| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | -| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | -| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | -| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | -| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | +| Equal | = | = | | = | = | = | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | Ctrl+= | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | Shift+= | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | Ctrl+Shift+= | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | Alt+= | alt+[Equal] | | +| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | Ctrl+Alt+= | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | Shift+Alt+= | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+[Equal] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | BracketLeft | х | | | х | [BracketLeft] | null | [BracketLeft] | NO | | Ctrl+BracketLeft | х | | | Ctrl+х | ctrl+[BracketLeft] | null | ctrl+[BracketLeft] | NO | diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts index f6c2e53e6ae..603deebeb44 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts @@ -1478,7 +1478,7 @@ suite('keyboardMapper', () => { { label: 'Ctrl+`', ariaLabel: 'Control+`', - electronAccelerator: null, + electronAccelerator: 'Ctrl+`', userSettingsLabel: 'ctrl+`', isWYSIWYG: true, isChord: false, @@ -1645,7 +1645,7 @@ suite('keyboardMapper - LINUX en_uk', () => { { label: 'Ctrl+Alt+-', ariaLabel: 'Control+Alt+-', - electronAccelerator: null, + electronAccelerator: 'Ctrl+Alt+-', userSettingsLabel: 'ctrl+alt+[Minus]', isWYSIWYG: false, isChord: false, diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt index d4274eed3e0..34044cdc5b5 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt @@ -469,14 +469,14 @@ isUSStandard: false | Shift+Alt+Period | : | Shift+Alt+; | | Shift+Alt+. | shift+alt+[Period] | null | shift+alt+[Period] | NO | | Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | null | ctrl+shift+alt+[Period] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Slash | - | - | | - | - | null | [Slash] | | +| Slash | - | - | | - | - | - | [Slash] | | | Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Slash] | | -| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | null | shift+[Slash] | | +| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Slash] | | | Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Slash] | | -| Alt+Slash | - | Alt+- | | Alt+- | alt+- | null | alt+[Slash] | | -| Ctrl+Alt+Slash | – | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | null | ctrl+alt+[Slash] | | -| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Slash] | | -| Ctrl+Shift+Alt+Slash | — | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Slash] | | +| Alt+Slash | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Slash] | | +| Ctrl+Alt+Slash | – | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | — | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Slash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt index 225d7411760..a1064d4b2af 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/mac_zh_hant.txt @@ -353,14 +353,14 @@ isUSStandard: false | Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+ㄦ | shift+alt+[Minus] | null | shift+alt+[Minus] | NO | | Ctrl+Shift+Alt+Minus | _ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+ㄦ | ctrl+shift+alt+[Minus] | null | ctrl+shift+alt+[Minus] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Equal | = | = | | = | = | null | [Equal] | | -| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | -| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | -| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | -| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | -| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | -| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | -| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | +| Equal | = | = | | = | = | = | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | Ctrl+= | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | Shift+= | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | Ctrl+Shift+= | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | Alt+= | alt+[Equal] | | +| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | Ctrl+Alt+= | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | Shift+Alt+= | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+[Equal] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | BracketLeft | 「 | | | 「 | [BracketLeft] | null | [BracketLeft] | NO | | Ctrl+BracketLeft | 「 | | | Ctrl+「 | ctrl+[BracketLeft] | null | ctrl+[BracketLeft] | NO | From 205a89c52346cc73e36d8564eba9e2d0fc74476a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 12 Oct 2021 15:17:46 +0200 Subject: [PATCH 5/9] Remove workaround for #108880 --- .../services/keybinding/common/macLinuxKeyboardMapper.ts | 6 ------ .../services/keybinding/test/electron-browser/mac_de_ch.txt | 4 ++-- .../services/keybinding/test/electron-browser/mac_en_us.txt | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index 941d1308e98..29a435956ce 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -885,12 +885,6 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { // Check if this scanCode always maps to the same keyCode and back const constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode); - // See https://github.com/microsoft/vscode/issues/108880 - if (this._OS === OperatingSystem.Macintosh && binding.ctrlKey && !binding.metaKey && !binding.altKey && constantKeyCode === KeyCode.US_MINUS) { - // ctrl+- and ctrl+shift+- render very similarly in native macOS menus, leading to confusion - return null; - } - if (constantKeyCode !== KeyCode.DependsOnKbLayout) { return KeyCodeUtils.toElectronAccelerator(constantKeyCode); } diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt index 34044cdc5b5..973d6a28603 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/mac_de_ch.txt @@ -470,9 +470,9 @@ isUSStandard: false | Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | null | ctrl+shift+alt+[Period] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Slash | - | - | | - | - | - | [Slash] | | -| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Slash] | | +| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Slash] | | | Shift+Slash | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Slash] | | -| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Slash] | | +| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Slash] | | | Alt+Slash | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Slash] | | | Ctrl+Alt+Slash | – | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Slash] | | | Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Slash] | | diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt b/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt index 5881abce1cf..7a83477293f 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/mac_en_us.txt @@ -345,9 +345,9 @@ isUSStandard: true | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Minus | - | - | | - | - | - | [Minus] | | -| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Minus] | | | Shift+Minus | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Minus] | | -| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Minus] | | | Alt+Minus | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Minus] | | | Ctrl+Alt+Minus | – | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Minus] | | | Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Minus] | | From 94ec6e1bc5e76a4bd54ce33bfa666b1e661e4b39 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Tue, 12 Oct 2021 15:30:59 +0200 Subject: [PATCH 6/9] Remove workaround for #101754 --- .../common/windowsKeyboardMapper.ts | 22 ------------------- .../windowsKeyboardMapper.test.ts | 10 ++++----- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts index 9d6b4fbb72d..425b24d4c6e 100644 --- a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts @@ -402,28 +402,6 @@ export class WindowsKeyboardMapper implements IKeyboardMapper { } public getElectronAcceleratorForKeyBinding(keybinding: SimpleKeybinding): string | null { - if (!this.isUSStandard) { - // See https://github.com/electron/electron/issues/26888 - // Electron does not render accelerators respecting the current keyboard layout since 3.x - const keyCode = keybinding.keyCode; - const isOEMKey = ( - keyCode === KeyCode.US_SEMICOLON - || keyCode === KeyCode.US_EQUAL - || keyCode === KeyCode.US_COMMA - || keyCode === KeyCode.US_MINUS - || keyCode === KeyCode.US_DOT - || keyCode === KeyCode.US_SLASH - || keyCode === KeyCode.US_BACKTICK - || keyCode === KeyCode.US_OPEN_SQUARE_BRACKET - || keyCode === KeyCode.US_BACKSLASH - || keyCode === KeyCode.US_CLOSE_SQUARE_BRACKET - || keyCode === KeyCode.OEM_8 - || keyCode === KeyCode.OEM_102 - ); - if (isOEMKey) { - return null; - } - } return KeyCodeUtils.toElectronAccelerator(keybinding.keyCode); } diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts index eb1b9c350b3..f63c3892478 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/windowsKeyboardMapper.test.ts @@ -100,7 +100,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+^', ariaLabel: 'Control+^', - electronAccelerator: null, + electronAccelerator: 'Ctrl+]', userSettingsLabel: 'ctrl+oem_6', isWYSIWYG: false, isChord: false, @@ -125,7 +125,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { { label: 'Ctrl+^', ariaLabel: 'Control+^', - electronAccelerator: null, + electronAccelerator: 'Ctrl+]', userSettingsLabel: 'ctrl+oem_6', isWYSIWYG: false, isChord: false, @@ -142,7 +142,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Shift+^', ariaLabel: 'Shift+^', - electronAccelerator: null, + electronAccelerator: 'Shift+]', userSettingsLabel: 'shift+oem_6', isWYSIWYG: false, isChord: false, @@ -159,7 +159,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+§', ariaLabel: 'Control+§', - electronAccelerator: null, + electronAccelerator: 'Ctrl+/', userSettingsLabel: 'ctrl+oem_2', isWYSIWYG: false, isChord: false, @@ -176,7 +176,7 @@ suite('keyboardMapper - WINDOWS de_ch', () => { [{ label: 'Ctrl+Shift+§', ariaLabel: 'Control+Shift+§', - electronAccelerator: null, + electronAccelerator: 'Ctrl+Shift+/', userSettingsLabel: 'ctrl+shift+oem_2', isWYSIWYG: false, isChord: false, From 6e701c847ec5766a964de30543e05da2ca2125fb Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 13 Oct 2021 00:21:03 +0200 Subject: [PATCH 7/9] Add more logging to capture case when the menu asks to dispatch a keybinding --- .../platform/keybinding/common/abstractKeybindingService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index f3d57e2e8db..be482403630 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -173,8 +173,11 @@ export abstract class AbstractKeybindingService extends Disposable implements IK } public dispatchByUserSettingsLabel(userSettingsLabel: string, target: IContextKeyServiceTarget): void { + this._log(`/ Dispatching keybinding triggered via menu entry accelerator - ${userSettingsLabel}`); const keybindings = this.resolveUserBinding(userSettingsLabel); - if (keybindings.length >= 1) { + if (keybindings.length === 0) { + this._log(`\\ Could not resolve - ${userSettingsLabel}`); + } else { this._doDispatch(keybindings[0], target, /*isSingleModiferChord*/false); } } From 344f2ba2aef190f7053e504286e36894dcfb905e Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 13 Oct 2021 00:35:07 +0200 Subject: [PATCH 8/9] Do not pass OEM keys to Electron on Linux when having a non US Standard keyboard layout (#23706) --- .../common/macLinuxKeyboardMapper.ts | 23 +++ .../test/electron-browser/linux_de_ch.txt | 16 +- .../test/electron-browser/linux_en_uk.txt | 160 +++++++++--------- .../test/electron-browser/linux_ru.txt | 32 ++-- .../macLinuxKeyboardMapper.test.ts | 4 +- 5 files changed, 129 insertions(+), 106 deletions(-) diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index 29a435956ce..081ab4698eb 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -885,6 +885,29 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { // Check if this scanCode always maps to the same keyCode and back const constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode); + if (this._OS === OperatingSystem.Linux && !this._isUSStandard) { + // [Electron Accelerators] On Linux, Electron does not handle correctly OEM keys. + // when using a different keyboard layout than US Standard. + // See https://github.com/microsoft/vscode/issues/23706 + // See https://github.com/microsoft/vscode/pull/134890#issuecomment-941671791 + const isOEMKey = ( + constantKeyCode === KeyCode.US_SEMICOLON + || constantKeyCode === KeyCode.US_EQUAL + || constantKeyCode === KeyCode.US_COMMA + || constantKeyCode === KeyCode.US_MINUS + || constantKeyCode === KeyCode.US_DOT + || constantKeyCode === KeyCode.US_SLASH + || constantKeyCode === KeyCode.US_BACKTICK + || constantKeyCode === KeyCode.US_OPEN_SQUARE_BRACKET + || constantKeyCode === KeyCode.US_BACKSLASH + || constantKeyCode === KeyCode.US_CLOSE_SQUARE_BRACKET + ); + + if (isOEMKey) { + return null; + } + } + if (constantKeyCode !== KeyCode.DependsOnKbLayout) { return KeyCodeUtils.toElectronAccelerator(constantKeyCode); } diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt index 1c73671253d..aaf9263ec26 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_de_ch.txt @@ -469,14 +469,14 @@ isUSStandard: false | Shift+Alt+Period | : | Shift+Alt+; | | Shift+Alt+. | shift+alt+[Period] | null | shift+alt+[Period] | NO | | Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | null | ctrl+shift+alt+[Period] | NO | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Slash | - | - | | - | - | - | [Slash] | | -| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Slash] | | -| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Slash] | | -| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Slash] | | -| Alt+Slash | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Slash] | | -| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Slash] | | -| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Slash] | | -| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Slash] | | +| Slash | - | - | | - | - | null | [Slash] | | +| Ctrl+Slash | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Slash] | | +| Shift+Slash | _ | Shift+- | | Shift+- | shift+- | null | shift+[Slash] | | +| Ctrl+Shift+Slash | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Slash] | | +| Alt+Slash | - | Alt+- | | Alt+- | alt+- | null | alt+[Slash] | | +| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | null | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Slash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt index e798186a3c0..9d1ab7184c4 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_en_uk.txt @@ -354,41 +354,41 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Minus | - | - | | - | - | - | [Minus] | | -| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Minus] | | -| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Minus] | | -| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Minus] | | -| Alt+Minus | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Minus] | | -| Ctrl+Alt+Minus | \ | \ | 1 | Ctrl+Alt+- | ctrl+alt+[Minus] | Ctrl+Alt+- | ctrl+alt+[Minus] | NO | -| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Minus] | | -| Ctrl+Shift+Alt+Minus | ¿ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Minus] | | +| Minus | - | - | | - | - | null | [Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | +| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | null | shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | +| Alt+Minus | - | Alt+- | | Alt+- | alt+- | null | alt+[Minus] | | +| Ctrl+Alt+Minus | \ | \ | 1 | Ctrl+Alt+- | ctrl+alt+[Minus] | null | ctrl+alt+[Minus] | NO | +| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Minus] | | +| Ctrl+Shift+Alt+Minus | ¿ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Minus] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Equal | = | = | | = | = | = | [Equal] | | -| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | Ctrl+= | ctrl+[Equal] | | -| Shift+Equal | + | Shift+= | | Shift+= | shift+= | Shift+= | shift+[Equal] | | -| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | Ctrl+Shift+= | ctrl+shift+[Equal] | | -| Alt+Equal | = | Alt+= | | Alt+= | alt+= | Alt+= | alt+[Equal] | | -| Ctrl+Alt+Equal | U+327 | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | Ctrl+Alt+= | ctrl+alt+[Equal] | | -| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | Shift+Alt+= | shift+alt+[Equal] | | -| Ctrl+Shift+Alt+Equal | U+328 | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+[Equal] | | +| Equal | = | = | | = | = | null | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | +| Ctrl+Alt+Equal | U+327 | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | U+328 | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| BracketLeft | [ | [ | 1 | [ | [ | [ | [BracketLeft] | | -| Ctrl+BracketLeft | [ | Ctrl+[ | | Ctrl+[ | ctrl+[ | Ctrl+[ | ctrl+[BracketLeft] | | -| Shift+BracketLeft | { | Shift+[ | 1 | Shift+[ | shift+[ | Shift+[ | shift+[BracketLeft] | | -| Ctrl+Shift+BracketLeft | { | Ctrl+Shift+[ | | Ctrl+Shift+[ | ctrl+shift+[ | Ctrl+Shift+[ | ctrl+shift+[BracketLeft] | | -| Alt+BracketLeft | [ | Alt+[ | | Alt+[ | alt+[ | Alt+[ | alt+[BracketLeft] | | -| Ctrl+Alt+BracketLeft | ¨ | Ctrl+Alt+[ | | Ctrl+Alt+[ | ctrl+alt+[ | Ctrl+Alt+[ | ctrl+alt+[BracketLeft] | | -| Shift+Alt+BracketLeft | { | Shift+Alt+[ | | Shift+Alt+[ | shift+alt+[ | Shift+Alt+[ | shift+alt+[BracketLeft] | | -| Ctrl+Shift+Alt+BracketLeft | ˚ | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[BracketLeft] | | +| BracketLeft | [ | [ | 1 | [ | [ | null | [BracketLeft] | | +| Ctrl+BracketLeft | [ | Ctrl+[ | | Ctrl+[ | ctrl+[ | null | ctrl+[BracketLeft] | | +| Shift+BracketLeft | { | Shift+[ | 1 | Shift+[ | shift+[ | null | shift+[BracketLeft] | | +| Ctrl+Shift+BracketLeft | { | Ctrl+Shift+[ | | Ctrl+Shift+[ | ctrl+shift+[ | null | ctrl+shift+[BracketLeft] | | +| Alt+BracketLeft | [ | Alt+[ | | Alt+[ | alt+[ | null | alt+[BracketLeft] | | +| Ctrl+Alt+BracketLeft | ¨ | Ctrl+Alt+[ | | Ctrl+Alt+[ | ctrl+alt+[ | null | ctrl+alt+[BracketLeft] | | +| Shift+Alt+BracketLeft | { | Shift+Alt+[ | | Shift+Alt+[ | shift+alt+[ | null | shift+alt+[BracketLeft] | | +| Ctrl+Shift+Alt+BracketLeft | ˚ | Ctrl+Shift+Alt+[ | | Ctrl+Shift+Alt+[ | ctrl+shift+alt+[ | null | ctrl+shift+alt+[BracketLeft] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| BracketRight | ] | ] | 1 | ] | ] | ] | [BracketRight] | | -| Ctrl+BracketRight | ] | Ctrl+] | | Ctrl+] | ctrl+] | Ctrl+] | ctrl+[BracketRight] | | -| Shift+BracketRight | } | Shift+] | 1 | Shift+] | shift+] | Shift+] | shift+[BracketRight] | | -| Ctrl+Shift+BracketRight | } | Ctrl+Shift+] | | Ctrl+Shift+] | ctrl+shift+] | Ctrl+Shift+] | ctrl+shift+[BracketRight] | | -| Alt+BracketRight | ] | Alt+] | | Alt+] | alt+] | Alt+] | alt+[BracketRight] | | -| Ctrl+Alt+BracketRight | ˜ | Ctrl+Alt+] | | Ctrl+Alt+] | ctrl+alt+] | Ctrl+Alt+] | ctrl+alt+[BracketRight] | | -| Shift+Alt+BracketRight | } | Shift+Alt+] | | Shift+Alt+] | shift+alt+] | Shift+Alt+] | shift+alt+[BracketRight] | | -| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | Ctrl+Shift+Alt+] | ctrl+shift+alt+[BracketRight] | | +| BracketRight | ] | ] | 1 | ] | ] | null | [BracketRight] | | +| Ctrl+BracketRight | ] | Ctrl+] | | Ctrl+] | ctrl+] | null | ctrl+[BracketRight] | | +| Shift+BracketRight | } | Shift+] | 1 | Shift+] | shift+] | null | shift+[BracketRight] | | +| Ctrl+Shift+BracketRight | } | Ctrl+Shift+] | | Ctrl+Shift+] | ctrl+shift+] | null | ctrl+shift+[BracketRight] | | +| Alt+BracketRight | ] | Alt+] | | Alt+] | alt+] | null | alt+[BracketRight] | | +| Ctrl+Alt+BracketRight | ˜ | Ctrl+Alt+] | | Ctrl+Alt+] | ctrl+alt+] | null | ctrl+alt+[BracketRight] | | +| Shift+Alt+BracketRight | } | Shift+Alt+] | | Shift+Alt+] | shift+alt+] | null | shift+alt+[BracketRight] | | +| Ctrl+Shift+Alt+BracketRight | ¯ | Ctrl+Shift+Alt+] | | Ctrl+Shift+Alt+] | ctrl+shift+alt+] | null | ctrl+shift+alt+[BracketRight] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -410,14 +410,14 @@ isUSStandard: false | Shift+Alt+IntlHash | --- | | | null | null | null | null | | | Ctrl+Shift+Alt+IntlHash | --- | | | null | null | null | null | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Semicolon | ; | ; | | ; | ; | ; | [Semicolon] | | -| Ctrl+Semicolon | ; | Ctrl+; | | Ctrl+; | ctrl+; | Ctrl+; | ctrl+[Semicolon] | | -| Shift+Semicolon | : | Shift+; | | Shift+; | shift+; | Shift+; | shift+[Semicolon] | | -| Ctrl+Shift+Semicolon | : | Ctrl+Shift+; | | Ctrl+Shift+; | ctrl+shift+; | Ctrl+Shift+; | ctrl+shift+[Semicolon] | | -| Alt+Semicolon | ; | Alt+; | | Alt+; | alt+; | Alt+; | alt+[Semicolon] | | -| Ctrl+Alt+Semicolon | ´ | Ctrl+Alt+; | | Ctrl+Alt+; | ctrl+alt+; | Ctrl+Alt+; | ctrl+alt+[Semicolon] | | -| Shift+Alt+Semicolon | : | Shift+Alt+; | | Shift+Alt+; | shift+alt+; | Shift+Alt+; | shift+alt+[Semicolon] | | -| Ctrl+Shift+Alt+Semicolon | ˝ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | Ctrl+Shift+Alt+; | ctrl+shift+alt+[Semicolon] | | +| Semicolon | ; | ; | | ; | ; | null | [Semicolon] | | +| Ctrl+Semicolon | ; | Ctrl+; | | Ctrl+; | ctrl+; | null | ctrl+[Semicolon] | | +| Shift+Semicolon | : | Shift+; | | Shift+; | shift+; | null | shift+[Semicolon] | | +| Ctrl+Shift+Semicolon | : | Ctrl+Shift+; | | Ctrl+Shift+; | ctrl+shift+; | null | ctrl+shift+[Semicolon] | | +| Alt+Semicolon | ; | Alt+; | | Alt+; | alt+; | null | alt+[Semicolon] | | +| Ctrl+Alt+Semicolon | ´ | Ctrl+Alt+; | | Ctrl+Alt+; | ctrl+alt+; | null | ctrl+alt+[Semicolon] | | +| Shift+Alt+Semicolon | : | Shift+Alt+; | | Shift+Alt+; | shift+alt+; | null | shift+alt+[Semicolon] | | +| Ctrl+Shift+Alt+Semicolon | ˝ | Ctrl+Shift+Alt+; | | Ctrl+Shift+Alt+; | ctrl+shift+alt+; | null | ctrl+shift+alt+[Semicolon] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Quote | ' | ' | | ' | ' | ' | [Quote] | | | Ctrl+Quote | ' | Ctrl+' | | Ctrl+' | ctrl+' | Ctrl+' | ctrl+[Quote] | | @@ -430,41 +430,41 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Backquote | ` | ` | 1 | ` | ` | ` | [Backquote] | | -| Ctrl+Backquote | ` | Ctrl+` | | Ctrl+` | ctrl+` | Ctrl+` | ctrl+[Backquote] | | -| Shift+Backquote | ¬ | Shift+` | 1 | Shift+` | shift+` | Shift+` | shift+[Backquote] | | -| Ctrl+Shift+Backquote | ¬ | Ctrl+Shift+` | 1 | Ctrl+Shift+` | ctrl+shift+` | Ctrl+Shift+` | ctrl+shift+[Backquote] | | -| Alt+Backquote | ` | Alt+` | | Alt+` | alt+` | Alt+` | alt+[Backquote] | | -| Ctrl+Alt+Backquote | | | Shift+\ | 1 | Ctrl+Alt+` | ctrl+alt+[Backquote] | Ctrl+Alt+` | ctrl+alt+[Backquote] | NO | -| Shift+Alt+Backquote | ¬ | Shift+Alt+` | 1 | Shift+Alt+` | shift+alt+` | Shift+Alt+` | shift+alt+[Backquote] | | -| Ctrl+Shift+Alt+Backquote | | | Ctrl+Shift+Alt+` | 1 | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | Ctrl+Shift+Alt+` | ctrl+shift+alt+[Backquote] | | +| Backquote | ` | ` | 1 | ` | ` | null | [Backquote] | | +| Ctrl+Backquote | ` | Ctrl+` | | Ctrl+` | ctrl+` | null | ctrl+[Backquote] | | +| Shift+Backquote | ¬ | Shift+` | 1 | Shift+` | shift+` | null | shift+[Backquote] | | +| Ctrl+Shift+Backquote | ¬ | Ctrl+Shift+` | 1 | Ctrl+Shift+` | ctrl+shift+` | null | ctrl+shift+[Backquote] | | +| Alt+Backquote | ` | Alt+` | | Alt+` | alt+` | null | alt+[Backquote] | | +| Ctrl+Alt+Backquote | | | Shift+\ | 1 | Ctrl+Alt+` | ctrl+alt+[Backquote] | null | ctrl+alt+[Backquote] | NO | +| Shift+Alt+Backquote | ¬ | Shift+Alt+` | 1 | Shift+Alt+` | shift+alt+` | null | shift+alt+[Backquote] | | +| Ctrl+Shift+Alt+Backquote | | | Ctrl+Shift+Alt+` | 1 | Ctrl+Shift+Alt+` | ctrl+shift+alt+` | null | ctrl+shift+alt+[Backquote] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Comma | , | , | | , | , | , | [Comma] | | -| Ctrl+Comma | , | Ctrl+, | | Ctrl+, | ctrl+, | Ctrl+, | ctrl+[Comma] | | -| Shift+Comma | < | Shift+, | 1 | Shift+, | shift+, | Shift+, | shift+[Comma] | | -| Ctrl+Shift+Comma | < | Ctrl+Shift+, | | Ctrl+Shift+, | ctrl+shift+, | Ctrl+Shift+, | ctrl+shift+[Comma] | | -| Alt+Comma | , | Alt+, | | Alt+, | alt+, | Alt+, | alt+[Comma] | | -| Ctrl+Alt+Comma | ─ | Ctrl+Alt+, | | Ctrl+Alt+, | ctrl+alt+, | Ctrl+Alt+, | ctrl+alt+[Comma] | | -| Shift+Alt+Comma | < | Shift+Alt+, | | Shift+Alt+, | shift+alt+, | Shift+Alt+, | shift+alt+[Comma] | | -| Ctrl+Shift+Alt+Comma | × | Ctrl+Shift+Alt+, | | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | Ctrl+Shift+Alt+, | ctrl+shift+alt+[Comma] | | +| Comma | , | , | | , | , | null | [Comma] | | +| Ctrl+Comma | , | Ctrl+, | | Ctrl+, | ctrl+, | null | ctrl+[Comma] | | +| Shift+Comma | < | Shift+, | 1 | Shift+, | shift+, | null | shift+[Comma] | | +| Ctrl+Shift+Comma | < | Ctrl+Shift+, | | Ctrl+Shift+, | ctrl+shift+, | null | ctrl+shift+[Comma] | | +| Alt+Comma | , | Alt+, | | Alt+, | alt+, | null | alt+[Comma] | | +| Ctrl+Alt+Comma | ─ | Ctrl+Alt+, | | Ctrl+Alt+, | ctrl+alt+, | null | ctrl+alt+[Comma] | | +| Shift+Alt+Comma | < | Shift+Alt+, | | Shift+Alt+, | shift+alt+, | null | shift+alt+[Comma] | | +| Ctrl+Shift+Alt+Comma | × | Ctrl+Shift+Alt+, | | Ctrl+Shift+Alt+, | ctrl+shift+alt+, | null | ctrl+shift+alt+[Comma] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Period | . | . | | . | . | . | [Period] | | -| Ctrl+Period | . | Ctrl+. | | Ctrl+. | ctrl+. | Ctrl+. | ctrl+[Period] | | -| Shift+Period | > | Shift+. | 1 | Shift+. | shift+. | Shift+. | shift+[Period] | | -| Ctrl+Shift+Period | > | Ctrl+Shift+. | | Ctrl+Shift+. | ctrl+shift+. | Ctrl+Shift+. | ctrl+shift+[Period] | | -| Alt+Period | . | Alt+. | | Alt+. | alt+. | Alt+. | alt+[Period] | | -| Ctrl+Alt+Period | · | Ctrl+Alt+. | | Ctrl+Alt+. | ctrl+alt+. | Ctrl+Alt+. | ctrl+alt+[Period] | | -| Shift+Alt+Period | > | Shift+Alt+. | | Shift+Alt+. | shift+alt+. | Shift+Alt+. | shift+alt+[Period] | | -| Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | Ctrl+Shift+Alt+. | ctrl+shift+alt+[Period] | | +| Period | . | . | | . | . | null | [Period] | | +| Ctrl+Period | . | Ctrl+. | | Ctrl+. | ctrl+. | null | ctrl+[Period] | | +| Shift+Period | > | Shift+. | 1 | Shift+. | shift+. | null | shift+[Period] | | +| Ctrl+Shift+Period | > | Ctrl+Shift+. | | Ctrl+Shift+. | ctrl+shift+. | null | ctrl+shift+[Period] | | +| Alt+Period | . | Alt+. | | Alt+. | alt+. | null | alt+[Period] | | +| Ctrl+Alt+Period | · | Ctrl+Alt+. | | Ctrl+Alt+. | ctrl+alt+. | null | ctrl+alt+[Period] | | +| Shift+Alt+Period | > | Shift+Alt+. | | Shift+Alt+. | shift+alt+. | null | shift+alt+[Period] | | +| Ctrl+Shift+Alt+Period | ÷ | Ctrl+Shift+Alt+. | | Ctrl+Shift+Alt+. | ctrl+shift+alt+. | null | ctrl+shift+alt+[Period] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Slash | / | / | | / | / | / | [Slash] | | -| Ctrl+Slash | / | Ctrl+/ | | Ctrl+/ | ctrl+/ | Ctrl+/ | ctrl+[Slash] | | -| Shift+Slash | ? | Shift+/ | | Shift+/ | shift+/ | Shift+/ | shift+[Slash] | | -| Ctrl+Shift+Slash | ? | Ctrl+Shift+/ | | Ctrl+Shift+/ | ctrl+shift+/ | Ctrl+Shift+/ | ctrl+shift+[Slash] | | -| Alt+Slash | / | Alt+/ | | Alt+/ | alt+/ | Alt+/ | alt+[Slash] | | -| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+/ | | Ctrl+Alt+/ | ctrl+alt+/ | Ctrl+Alt+/ | ctrl+alt+[Slash] | | -| Shift+Alt+Slash | ? | Shift+Alt+/ | | Shift+Alt+/ | shift+alt+/ | Shift+Alt+/ | shift+alt+[Slash] | | -| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+/ | | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | Ctrl+Shift+Alt+/ | ctrl+shift+alt+[Slash] | | +| Slash | / | / | | / | / | null | [Slash] | | +| Ctrl+Slash | / | Ctrl+/ | | Ctrl+/ | ctrl+/ | null | ctrl+[Slash] | | +| Shift+Slash | ? | Shift+/ | | Shift+/ | shift+/ | null | shift+[Slash] | | +| Ctrl+Shift+Slash | ? | Ctrl+Shift+/ | | Ctrl+Shift+/ | ctrl+shift+/ | null | ctrl+shift+[Slash] | | +| Alt+Slash | / | Alt+/ | | Alt+/ | alt+/ | null | alt+[Slash] | | +| Ctrl+Alt+Slash | U+323 | Ctrl+Alt+/ | | Ctrl+Alt+/ | ctrl+alt+/ | null | ctrl+alt+[Slash] | | +| Shift+Alt+Slash | ? | Shift+Alt+/ | | Shift+Alt+/ | shift+alt+/ | null | shift+alt+[Slash] | | +| Ctrl+Shift+Alt+Slash | ˙ | Ctrl+Shift+Alt+/ | | Ctrl+Shift+Alt+/ | ctrl+shift+alt+/ | null | ctrl+shift+alt+[Slash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -486,14 +486,14 @@ isUSStandard: false | Shift+Alt+Numpad0 | --- | Shift+Alt+NumPad0 | | Shift+Alt+NumPad0 | shift+alt+numpad0 | null | shift+alt+[Numpad0] | | | Ctrl+Shift+Alt+Numpad0 | --- | Ctrl+Shift+Alt+NumPad0 | | Ctrl+Shift+Alt+NumPad0 | ctrl+shift+alt+numpad0 | null | ctrl+shift+alt+[Numpad0] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| IntlBackslash | \ | \ | 2 | \ | \ | \ | [IntlBackslash] | | -| Ctrl+IntlBackslash | \ | Ctrl+\ | | Ctrl+\ | ctrl+\ | Ctrl+\ | ctrl+[IntlBackslash] | | -| Shift+IntlBackslash | | | Shift+\ | 2 | Shift+\ | shift+\ | Shift+\ | shift+[IntlBackslash] | | -| Ctrl+Shift+IntlBackslash | | | Ctrl+Shift+\ | | Ctrl+Shift+\ | ctrl+shift+\ | Ctrl+Shift+\ | ctrl+shift+[IntlBackslash] | | -| Alt+IntlBackslash | \ | Alt+\ | | Alt+\ | alt+\ | Alt+\ | alt+[IntlBackslash] | | -| Ctrl+Alt+IntlBackslash | | | Ctrl+Alt+\ | | Ctrl+Alt+\ | ctrl+alt+\ | Ctrl+Alt+\ | ctrl+alt+[IntlBackslash] | | -| Shift+Alt+IntlBackslash | | | Shift+Alt+\ | | Shift+Alt+\ | shift+alt+\ | Shift+Alt+\ | shift+alt+[IntlBackslash] | | -| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | Ctrl+Shift+Alt+\ | ctrl+shift+alt+[IntlBackslash] | | +| IntlBackslash | \ | \ | 2 | \ | \ | null | [IntlBackslash] | | +| Ctrl+IntlBackslash | \ | Ctrl+\ | | Ctrl+\ | ctrl+\ | null | ctrl+[IntlBackslash] | | +| Shift+IntlBackslash | | | Shift+\ | 2 | Shift+\ | shift+\ | null | shift+[IntlBackslash] | | +| Ctrl+Shift+IntlBackslash | | | Ctrl+Shift+\ | | Ctrl+Shift+\ | ctrl+shift+\ | null | ctrl+shift+[IntlBackslash] | | +| Alt+IntlBackslash | \ | Alt+\ | | Alt+\ | alt+\ | null | alt+[IntlBackslash] | | +| Ctrl+Alt+IntlBackslash | | | Ctrl+Alt+\ | | Ctrl+Alt+\ | ctrl+alt+\ | null | ctrl+alt+[IntlBackslash] | | +| Shift+Alt+IntlBackslash | | | Shift+Alt+\ | | Shift+Alt+\ | shift+alt+\ | null | shift+alt+[IntlBackslash] | | +| Ctrl+Shift+Alt+IntlBackslash | ¦ | Ctrl+Shift+Alt+\ | | Ctrl+Shift+Alt+\ | ctrl+shift+alt+\ | null | ctrl+shift+alt+[IntlBackslash] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | IntlRo | --- | | | null | [IntlRo] | null | [IntlRo] | NO | | Ctrl+IntlRo | --- | | | null | ctrl+[IntlRo] | null | ctrl+[IntlRo] | NO | diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt index 7179276ad1d..389681ee995 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt +++ b/src/vs/workbench/services/keybinding/test/electron-browser/linux_ru.txt @@ -360,23 +360,23 @@ isUSStandard: false ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Minus | - | - | | - | - | - | [Minus] | | -| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | Ctrl+- | ctrl+[Minus] | | -| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | Shift+- | shift+[Minus] | | -| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | Ctrl+Shift+- | ctrl+shift+[Minus] | | -| Alt+Minus | - | Alt+- | | Alt+- | alt+- | Alt+- | alt+[Minus] | | -| Ctrl+Alt+Minus | - | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | Ctrl+Alt+- | ctrl+alt+[Minus] | | -| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | Shift+Alt+- | shift+alt+[Minus] | | -| Ctrl+Shift+Alt+Minus | _ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | Ctrl+Shift+Alt+- | ctrl+shift+alt+[Minus] | | +| Minus | - | - | | - | - | null | [Minus] | | +| Ctrl+Minus | - | Ctrl+- | | Ctrl+- | ctrl+- | null | ctrl+[Minus] | | +| Shift+Minus | _ | Shift+- | | Shift+- | shift+- | null | shift+[Minus] | | +| Ctrl+Shift+Minus | _ | Ctrl+Shift+- | | Ctrl+Shift+- | ctrl+shift+- | null | ctrl+shift+[Minus] | | +| Alt+Minus | - | Alt+- | | Alt+- | alt+- | null | alt+[Minus] | | +| Ctrl+Alt+Minus | - | Ctrl+Alt+- | | Ctrl+Alt+- | ctrl+alt+- | null | ctrl+alt+[Minus] | | +| Shift+Alt+Minus | _ | Shift+Alt+- | | Shift+Alt+- | shift+alt+- | null | shift+alt+[Minus] | | +| Ctrl+Shift+Alt+Minus | _ | Ctrl+Shift+Alt+- | | Ctrl+Shift+Alt+- | ctrl+shift+alt+- | null | ctrl+shift+alt+[Minus] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| Equal | = | = | | = | = | = | [Equal] | | -| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | Ctrl+= | ctrl+[Equal] | | -| Shift+Equal | + | Shift+= | | Shift+= | shift+= | Shift+= | shift+[Equal] | | -| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | Ctrl+Shift+= | ctrl+shift+[Equal] | | -| Alt+Equal | = | Alt+= | | Alt+= | alt+= | Alt+= | alt+[Equal] | | -| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | Ctrl+Alt+= | ctrl+alt+[Equal] | | -| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | Shift+Alt+= | shift+alt+[Equal] | | -| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | Ctrl+Shift+Alt+= | ctrl+shift+alt+[Equal] | | +| Equal | = | = | | = | = | null | [Equal] | | +| Ctrl+Equal | = | Ctrl+= | | Ctrl+= | ctrl+= | null | ctrl+[Equal] | | +| Shift+Equal | + | Shift+= | | Shift+= | shift+= | null | shift+[Equal] | | +| Ctrl+Shift+Equal | + | Ctrl+Shift+= | | Ctrl+Shift+= | ctrl+shift+= | null | ctrl+shift+[Equal] | | +| Alt+Equal | = | Alt+= | | Alt+= | alt+= | null | alt+[Equal] | | +| Ctrl+Alt+Equal | = | Ctrl+Alt+= | | Ctrl+Alt+= | ctrl+alt+= | null | ctrl+alt+[Equal] | | +| Shift+Alt+Equal | + | Shift+Alt+= | | Shift+Alt+= | shift+alt+= | null | shift+alt+[Equal] | | +| Ctrl+Shift+Alt+Equal | + | Ctrl+Shift+Alt+= | | Ctrl+Shift+Alt+= | ctrl+shift+alt+= | null | ctrl+shift+alt+[Equal] | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | BracketLeft | х | | | х | [BracketLeft] | null | [BracketLeft] | NO | | Ctrl+BracketLeft | х | | | Ctrl+х | ctrl+[BracketLeft] | null | ctrl+[BracketLeft] | NO | diff --git a/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts index 603deebeb44..f6c2e53e6ae 100644 --- a/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/electron-browser/macLinuxKeyboardMapper.test.ts @@ -1478,7 +1478,7 @@ suite('keyboardMapper', () => { { label: 'Ctrl+`', ariaLabel: 'Control+`', - electronAccelerator: 'Ctrl+`', + electronAccelerator: null, userSettingsLabel: 'ctrl+`', isWYSIWYG: true, isChord: false, @@ -1645,7 +1645,7 @@ suite('keyboardMapper - LINUX en_uk', () => { { label: 'Ctrl+Alt+-', ariaLabel: 'Control+Alt+-', - electronAccelerator: 'Ctrl+Alt+-', + electronAccelerator: null, userSettingsLabel: 'ctrl+alt+[Minus]', isWYSIWYG: false, isChord: false, From 779360bdd62976f9deba3ab771079188289f89ae Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 13 Oct 2021 00:45:22 +0200 Subject: [PATCH 9/9] Remove `electronAcceleratorMap` since it only contains 4 special cases --- src/vs/base/common/keyCodes.ts | 67 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/vs/base/common/keyCodes.ts b/src/vs/base/common/keyCodes.ts index 87423c4c0ca..e2aff2ec8d7 100644 --- a/src/vs/base/common/keyCodes.ts +++ b/src/vs/base/common/keyCodes.ts @@ -228,24 +228,13 @@ class KeyCodeStrMap { const uiMap = new KeyCodeStrMap(); const userSettingsUSMap = new KeyCodeStrMap(); const userSettingsGeneralMap = new KeyCodeStrMap(); -const electronAcceleratorMap = new KeyCodeStrMap(); (function () { - function define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel?: string, generalUserSettingsLabel?: string, electronAcceleratorLabel?: string): void { - if (typeof usUserSettingsLabel === 'undefined') { - usUserSettingsLabel = uiLabel; - } - if (typeof generalUserSettingsLabel === 'undefined') { - generalUserSettingsLabel = usUserSettingsLabel; - } - if (typeof electronAcceleratorLabel === 'undefined') { - electronAcceleratorLabel = uiLabel; - } + function define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void { uiMap.define(keyCode, uiLabel); userSettingsUSMap.define(keyCode, usUserSettingsLabel); userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - electronAcceleratorMap.define(keyCode, electronAcceleratorLabel); } define(KeyCode.Unknown, 'unknown'); @@ -265,10 +254,10 @@ const electronAcceleratorMap = new KeyCodeStrMap(); define(KeyCode.End, 'End'); define(KeyCode.Home, 'Home'); - define(KeyCode.LeftArrow, 'LeftArrow', 'Left', undefined, 'Left'); - define(KeyCode.UpArrow, 'UpArrow', 'Up', undefined, 'Up'); - define(KeyCode.RightArrow, 'RightArrow', 'Right', undefined, 'Right'); - define(KeyCode.DownArrow, 'DownArrow', 'Down', undefined, 'Down'); + define(KeyCode.LeftArrow, 'LeftArrow', 'Left'); + define(KeyCode.UpArrow, 'UpArrow', 'Up'); + define(KeyCode.RightArrow, 'RightArrow', 'Right'); + define(KeyCode.DownArrow, 'DownArrow', 'Down'); define(KeyCode.Insert, 'Insert'); define(KeyCode.Delete, 'Delete'); @@ -352,23 +341,23 @@ const electronAcceleratorMap = new KeyCodeStrMap(); define(KeyCode.OEM_8, 'OEM_8'); define(KeyCode.OEM_102, 'OEM_102'); - define(KeyCode.NUMPAD_0, 'NumPad0', undefined, undefined, 'num0'); - define(KeyCode.NUMPAD_1, 'NumPad1', undefined, undefined, 'num1'); - define(KeyCode.NUMPAD_2, 'NumPad2', undefined, undefined, 'num2'); - define(KeyCode.NUMPAD_3, 'NumPad3', undefined, undefined, 'num3'); - define(KeyCode.NUMPAD_4, 'NumPad4', undefined, undefined, 'num4'); - define(KeyCode.NUMPAD_5, 'NumPad5', undefined, undefined, 'num5'); - define(KeyCode.NUMPAD_6, 'NumPad6', undefined, undefined, 'num6'); - define(KeyCode.NUMPAD_7, 'NumPad7', undefined, undefined, 'num7'); - define(KeyCode.NUMPAD_8, 'NumPad8', undefined, undefined, 'num8'); - define(KeyCode.NUMPAD_9, 'NumPad9', undefined, undefined, 'num9'); + define(KeyCode.NUMPAD_0, 'NumPad0'); + define(KeyCode.NUMPAD_1, 'NumPad1'); + define(KeyCode.NUMPAD_2, 'NumPad2'); + define(KeyCode.NUMPAD_3, 'NumPad3'); + define(KeyCode.NUMPAD_4, 'NumPad4'); + define(KeyCode.NUMPAD_5, 'NumPad5'); + define(KeyCode.NUMPAD_6, 'NumPad6'); + define(KeyCode.NUMPAD_7, 'NumPad7'); + define(KeyCode.NUMPAD_8, 'NumPad8'); + define(KeyCode.NUMPAD_9, 'NumPad9'); - define(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply', undefined, undefined, 'nummult'); - define(KeyCode.NUMPAD_ADD, 'NumPad_Add', undefined, undefined, 'numadd'); - define(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator', undefined, undefined, 'numsep'); - define(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract', undefined, undefined, 'numsub'); - define(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal', undefined, undefined, 'numdec'); - define(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide', undefined, undefined, 'numdiv'); + define(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply'); + define(KeyCode.NUMPAD_ADD, 'NumPad_Add'); + define(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator'); + define(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract'); + define(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal'); + define(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide'); })(); @@ -402,7 +391,19 @@ export namespace KeyCodeUtils { // We therefore need to fall back to custom rendering for numpad keys. return null; } - return electronAcceleratorMap.keyCodeToStr(keyCode); + + switch (keyCode) { + case KeyCode.UpArrow: + return 'Up'; + case KeyCode.DownArrow: + return 'Down'; + case KeyCode.LeftArrow: + return 'Left'; + case KeyCode.RightArrow: + return 'Right'; + } + + return uiMap.keyCodeToStr(keyCode); } }