提交 c749f235 编写于 作者: A Alex Dima

Fixes #24522: Ctrl+Alt+[Minus] under English (UK) keyboard layout on Linux

上级 c688f7c5
......@@ -86,7 +86,7 @@ export class KeybindingLabel implements IDisposable {
if (part.metaKey) {
this.renderKey(parent, modifierLabels.metaKey, match && match.metaKey, modifierLabels.separator);
}
const keyLabel = part.kbLabel;
const keyLabel = part.keyLabel;
if (keyLabel) {
this.renderKey(parent, keyLabel, match && match.keyCode, '');
}
......
......@@ -552,16 +552,16 @@ export class ResolvedKeybindingPart {
readonly altKey: boolean;
readonly metaKey: boolean;
readonly kbLabel: string;
readonly kbAriaLabel: string;
readonly keyLabel: string;
readonly keyAriaLabel: string;
constructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string, kbAriaLabel: string) {
this.ctrlKey = ctrlKey;
this.shiftKey = shiftKey;
this.altKey = altKey;
this.metaKey = metaKey;
this.kbLabel = kbLabel;
this.kbAriaLabel = kbAriaLabel;
this.keyLabel = kbLabel;
this.keyAriaLabel = kbAriaLabel;
}
}
......
......@@ -384,7 +384,7 @@ class KeybindingItemMatches {
if (!keybinding) {
return false;
}
const ariaLabel = keybinding.kbAriaLabel;
const ariaLabel = keybinding.keyAriaLabel;
if (ariaLabel.length === 1 || word.length === 1) {
if (strings.compareIgnoreCase(ariaLabel, word) === 0) {
return true;
......
......@@ -87,80 +87,43 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
this._chordPart = chordPart;
}
private _getUILabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
return this._mapper.getUILabelForScanCode(binding.scanCode);
}
public getLabel(): string {
let firstPart = this._getUILabelForScanCodeBinding(this._firstPart);
let chordPart = this._getUILabelForScanCodeBinding(this._chordPart);
let firstPart = this._mapper.getUILabelForScanCodeBinding(this._firstPart);
let chordPart = this._mapper.getUILabelForScanCodeBinding(this._chordPart);
return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS);
}
private _getAriaLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
return this._mapper.getAriaLabelForScanCode(binding.scanCode);
}
public getAriaLabel(): string {
let firstPart = this._getAriaLabelForScanCodeBinding(this._firstPart);
let chordPart = this._getAriaLabelForScanCodeBinding(this._chordPart);
let firstPart = this._mapper.getAriaLabelForScanCodeBinding(this._firstPart);
let chordPart = this._mapper.getAriaLabelForScanCodeBinding(this._chordPart);
return AriaLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS);
}
private _getElectronAcceleratorLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return null;
}
return this._mapper.getElectronLabelForScanCode(binding.scanCode);
}
public getElectronAccelerator(): string {
if (this._chordPart !== null) {
// Electron cannot handle chords
return null;
}
let firstPart = this._getElectronAcceleratorLabelForScanCodeBinding(this._firstPart);
let firstPart = this._mapper.getElectronAcceleratorLabelForScanCodeBinding(this._firstPart);
return ElectronAcceleratorLabelProvider.toLabel(this._firstPart, firstPart, null, null, this._OS);
}
private _getUserSettingsLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
return this._mapper.getUserSettingsLabel(binding.scanCode);
}
public getUserSettingsLabel(): string {
let firstPart = this._getUserSettingsLabelForScanCodeBinding(this._firstPart);
let chordPart = this._getUserSettingsLabelForScanCodeBinding(this._chordPart);
let firstPart = this._mapper.getUserSettingsLabelForScanCodeBinding(this._firstPart);
let chordPart = this._mapper.getUserSettingsLabelForScanCodeBinding(this._chordPart);
return UserSettingsLabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, this._OS);
}
private _isWYSIWYG(scanCode: ScanCode): boolean {
if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) {
private _isWYSIWYG(binding: ScanCodeBinding): boolean {
if (!binding) {
return true;
}
let a = this._mapper.getAriaLabelForScanCode(scanCode);
let b = this._mapper.getUserSettingsLabel(scanCode);
if (IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode] !== -1) {
return true;
}
let a = this._mapper.getAriaLabelForScanCodeBinding(binding);
let b = this._mapper.getUserSettingsLabelForScanCodeBinding(binding);
if (!a && !b) {
return true;
......@@ -172,10 +135,7 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
}
public isWYSIWYG(): boolean {
let result = true;
result = result && (this._firstPart ? this._isWYSIWYG(this._firstPart.scanCode) : true);
result = result && (this._chordPart ? this._isWYSIWYG(this._chordPart.scanCode) : true);
return result;
return (this._isWYSIWYG(this._firstPart) && this._isWYSIWYG(this._chordPart));
}
public isChord(): boolean {
......@@ -199,8 +159,8 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
binding.shiftKey,
binding.altKey,
binding.metaKey,
this._getUILabelForScanCodeBinding(binding),
this._getAriaLabelForScanCodeBinding(binding)
this._mapper.getUILabelForScanCodeBinding(binding),
this._mapper.getAriaLabelForScanCodeBinding(binding)
);
}
......@@ -900,9 +860,15 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
return result;
}
public getUILabelForScanCode(scanCode: ScanCode): string {
public getUILabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
if (this._OS === OperatingSystem.Macintosh) {
switch (scanCode) {
switch (binding.scanCode) {
case ScanCode.ArrowLeft:
return '';
case ScanCode.ArrowUp:
......@@ -913,11 +879,17 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
return '';
}
}
return this._scanCodeToLabel[scanCode];
return this._scanCodeToLabel[binding.scanCode];
}
public getAriaLabelForScanCode(scanCode: ScanCode): string {
return this._scanCodeToLabel[scanCode];
public getAriaLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
return this._scanCodeToLabel[binding.scanCode];
}
public getDispatchStrForScanCodeBinding(keypress: ScanCodeBinding): string {
......@@ -944,19 +916,33 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
return result;
}
public getUserSettingsLabel(scanCode: ScanCode): string {
const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];
public getUserSettingsLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return '';
}
const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode];
if (immutableKeyCode !== -1) {
return USER_SETTINGS.fromKeyCode(immutableKeyCode).toLowerCase();
}
// Check if this scanCode always maps to the same keyCode and back
let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(scanCode);
let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode);
if (constantKeyCode !== -1) {
return USER_SETTINGS.fromKeyCode(constantKeyCode).toLowerCase();
// Verify that this is a good key code that can be mapped back to the same scan code
let reverseBindings = this.simpleKeybindingToScanCodeBinding(new SimpleKeybinding(binding.ctrlKey, binding.shiftKey, binding.altKey, binding.metaKey, constantKeyCode));
for (let i = 0, len = reverseBindings.length; i < len; i++) {
const reverseBinding = reverseBindings[i];
if (reverseBinding.scanCode === binding.scanCode) {
return USER_SETTINGS.fromKeyCode(constantKeyCode).toLowerCase();
}
}
}
return this._scanCodeToDispatch[scanCode];
return this._scanCodeToDispatch[binding.scanCode];
}
private _getElectronLabelForKeyCode(keyCode: KeyCode): string {
......@@ -980,14 +966,21 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
return KeyCodeUtils.toString(keyCode);
}
public getElectronLabelForScanCode(scanCode: ScanCode): string {
const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];
public getElectronAcceleratorLabelForScanCodeBinding(binding: ScanCodeBinding): string {
if (!binding) {
return null;
}
if (binding.isDuplicateModifierCase()) {
return null;
}
const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode];
if (immutableKeyCode !== -1) {
return this._getElectronLabelForKeyCode(immutableKeyCode);
}
// Check if this scanCode always maps to the same keyCode and back
let constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(scanCode);
const constantKeyCode: KeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(binding.scanCode);
if (!this._isUSStandard) {
// Electron cannot handle these key codes on anything else than standard US
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
define({
"Sleep": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"WakeUp": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"KeyA": {
"value": "a",
"withShift": "A",
"withAltGr": "æ",
"withShiftAltGr": "Æ"
},
"KeyB": {
"value": "b",
"withShift": "B",
"withAltGr": "",
"withShiftAltGr": ""
},
"KeyC": {
"value": "c",
"withShift": "C",
"withAltGr": "¢",
"withShiftAltGr": "©"
},
"KeyD": {
"value": "d",
"withShift": "D",
"withAltGr": "ð",
"withShiftAltGr": "Ð"
},
"KeyE": {
"value": "e",
"withShift": "E",
"withAltGr": "e",
"withShiftAltGr": "E"
},
"KeyF": {
"value": "f",
"withShift": "F",
"withAltGr": "đ",
"withShiftAltGr": "ª"
},
"KeyG": {
"value": "g",
"withShift": "G",
"withAltGr": "ŋ",
"withShiftAltGr": "Ŋ"
},
"KeyH": {
"value": "h",
"withShift": "H",
"withAltGr": "ħ",
"withShiftAltGr": "Ħ"
},
"KeyI": {
"value": "i",
"withShift": "I",
"withAltGr": "",
"withShiftAltGr": "ı"
},
"KeyJ": {
"value": "j",
"withShift": "J",
"withAltGr": "̉",
"withShiftAltGr": "̛"
},
"KeyK": {
"value": "k",
"withShift": "K",
"withAltGr": "ĸ",
"withShiftAltGr": "&"
},
"KeyL": {
"value": "l",
"withShift": "L",
"withAltGr": "ł",
"withShiftAltGr": "Ł"
},
"KeyM": {
"value": "m",
"withShift": "M",
"withAltGr": "µ",
"withShiftAltGr": "º"
},
"KeyN": {
"value": "n",
"withShift": "N",
"withAltGr": "n",
"withShiftAltGr": "N"
},
"KeyO": {
"value": "o",
"withShift": "O",
"withAltGr": "ø",
"withShiftAltGr": "Ø"
},
"KeyP": {
"value": "p",
"withShift": "P",
"withAltGr": "þ",
"withShiftAltGr": "Þ"
},
"KeyQ": {
"value": "q",
"withShift": "Q",
"withAltGr": "@",
"withShiftAltGr": "Ω"
},
"KeyR": {
"value": "r",
"withShift": "R",
"withAltGr": "",
"withShiftAltGr": "®"
},
"KeyS": {
"value": "s",
"withShift": "S",
"withAltGr": "ß",
"withShiftAltGr": "§"
},
"KeyT": {
"value": "t",
"withShift": "T",
"withAltGr": "ŧ",
"withShiftAltGr": "Ŧ"
},
"KeyU": {
"value": "u",
"withShift": "U",
"withAltGr": "",
"withShiftAltGr": ""
},
"KeyV": {
"value": "v",
"withShift": "V",
"withAltGr": "",
"withShiftAltGr": ""
},
"KeyW": {
"value": "w",
"withShift": "W",
"withAltGr": "ł",
"withShiftAltGr": "Ł"
},
"KeyX": {
"value": "x",
"withShift": "X",
"withAltGr": "»",
"withShiftAltGr": ">"
},
"KeyY": {
"value": "y",
"withShift": "Y",
"withAltGr": "",
"withShiftAltGr": "¥"
},
"KeyZ": {
"value": "z",
"withShift": "Z",
"withAltGr": "«",
"withShiftAltGr": "<"
},
"Digit1": {
"value": "1",
"withShift": "!",
"withAltGr": "¹",
"withShiftAltGr": "¡"
},
"Digit2": {
"value": "2",
"withShift": "\"",
"withAltGr": "²",
"withShiftAltGr": ""
},
"Digit3": {
"value": "3",
"withShift": "£",
"withAltGr": "³",
"withShiftAltGr": "£"
},
"Digit4": {
"value": "4",
"withShift": "$",
"withAltGr": "",
"withShiftAltGr": "¼"
},
"Digit5": {
"value": "5",
"withShift": "%",
"withAltGr": "½",
"withShiftAltGr": ""
},
"Digit6": {
"value": "6",
"withShift": "^",
"withAltGr": "¾",
"withShiftAltGr": ""
},
"Digit7": {
"value": "7",
"withShift": "&",
"withAltGr": "{",
"withShiftAltGr": ""
},
"Digit8": {
"value": "8",
"withShift": "*",
"withAltGr": "[",
"withShiftAltGr": ""
},
"Digit9": {
"value": "9",
"withShift": "(",
"withAltGr": "]",
"withShiftAltGr": "±"
},
"Digit0": {
"value": "0",
"withShift": ")",
"withAltGr": "}",
"withShiftAltGr": "°"
},
"Enter": {
"value": "\r",
"withShift": "\r",
"withAltGr": "\r",
"withShiftAltGr": "\r"
},
"Escape": {
"value": "\u001b",
"withShift": "\u001b",
"withAltGr": "\u001b",
"withShiftAltGr": "\u001b"
},
"Backspace": {
"value": "\b",
"withShift": "\b",
"withAltGr": "\b",
"withShiftAltGr": "\b"
},
"Tab": {
"value": "\t",
"withShift": "",
"withAltGr": "\t",
"withShiftAltGr": ""
},
"Space": {
"value": " ",
"withShift": " ",
"withAltGr": " ",
"withShiftAltGr": " "
},
"Minus": {
"value": "-",
"withShift": "_",
"withAltGr": "\\",
"withShiftAltGr": "¿"
},
"Equal": {
"value": "=",
"withShift": "+",
"withAltGr": "̧",
"withShiftAltGr": "̨"
},
"BracketLeft": {
"value": "[",
"withShift": "{",
"withAltGr": "̈",
"withShiftAltGr": "̊"
},
"BracketRight": {
"value": "]",
"withShift": "}",
"withAltGr": "̃",
"withShiftAltGr": "̄"
},
"Backslash": {
"value": "#",
"withShift": "~",
"withAltGr": "̀",
"withShiftAltGr": "̆"
},
"Semicolon": {
"value": ";",
"withShift": ":",
"withAltGr": "́",
"withShiftAltGr": "̋"
},
"Quote": {
"value": "'",
"withShift": "@",
"withAltGr": "̂",
"withShiftAltGr": "̌"
},
"Backquote": {
"value": "`",
"withShift": "¬",
"withAltGr": "|",
"withShiftAltGr": "|"
},
"Comma": {
"value": ",",
"withShift": "<",
"withAltGr": "",
"withShiftAltGr": "×"
},
"Period": {
"value": ".",
"withShift": ">",
"withAltGr": "·",
"withShiftAltGr": "÷"
},
"Slash": {
"value": "/",
"withShift": "?",
"withAltGr": "̣",
"withShiftAltGr": "̇"
},
"CapsLock": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F1": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F2": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F3": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F4": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F5": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F6": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F7": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F8": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F9": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F10": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F11": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F12": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"PrintScreen": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ScrollLock": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Pause": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Insert": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Home": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"PageUp": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Delete": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"End": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"PageDown": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ArrowRight": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ArrowLeft": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ArrowDown": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ArrowUp": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NumLock": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NumpadDivide": {
"value": "/",
"withShift": "/",
"withAltGr": "/",
"withShiftAltGr": "/"
},
"NumpadMultiply": {
"value": "*",
"withShift": "*",
"withAltGr": "*",
"withShiftAltGr": "*"
},
"NumpadSubtract": {
"value": "-",
"withShift": "-",
"withAltGr": "-",
"withShiftAltGr": "-"
},
"NumpadAdd": {
"value": "+",
"withShift": "+",
"withAltGr": "+",
"withShiftAltGr": "+"
},
"NumpadEnter": {
"value": "\r",
"withShift": "\r",
"withAltGr": "\r",
"withShiftAltGr": "\r"
},
"Numpad1": {
"value": "",
"withShift": "1",
"withAltGr": "",
"withShiftAltGr": "1"
},
"Numpad2": {
"value": "",
"withShift": "2",
"withAltGr": "",
"withShiftAltGr": "2"
},
"Numpad3": {
"value": "",
"withShift": "3",
"withAltGr": "",
"withShiftAltGr": "3"
},
"Numpad4": {
"value": "",
"withShift": "4",
"withAltGr": "",
"withShiftAltGr": "4"
},
"Numpad5": {
"value": "",
"withShift": "5",
"withAltGr": "",
"withShiftAltGr": "5"
},
"Numpad6": {
"value": "",
"withShift": "6",
"withAltGr": "",
"withShiftAltGr": "6"
},
"Numpad7": {
"value": "",
"withShift": "7",
"withAltGr": "",
"withShiftAltGr": "7"
},
"Numpad8": {
"value": "",
"withShift": "8",
"withAltGr": "",
"withShiftAltGr": "8"
},
"Numpad9": {
"value": "",
"withShift": "9",
"withAltGr": "",
"withShiftAltGr": "9"
},
"Numpad0": {
"value": "",
"withShift": "0",
"withAltGr": "",
"withShiftAltGr": "0"
},
"NumpadDecimal": {
"value": "",
"withShift": ".",
"withAltGr": "",
"withShiftAltGr": "."
},
"IntlBackslash": {
"value": "\\",
"withShift": "|",
"withAltGr": "|",
"withShiftAltGr": "¦"
},
"ContextMenu": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Power": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NumpadEqual": {
"value": "=",
"withShift": "=",
"withAltGr": "=",
"withShiftAltGr": "="
},
"F13": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F14": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F15": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F16": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F17": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F18": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F19": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F20": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F21": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F22": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F23": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"F24": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Open": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Help": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Select": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Again": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Undo": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Cut": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Copy": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Paste": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Find": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"AudioVolumeMute": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"AudioVolumeUp": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"AudioVolumeDown": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NumpadComma": {
"value": ".",
"withShift": ".",
"withAltGr": ".",
"withShiftAltGr": "."
},
"IntlRo": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"KanaMode": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"IntlYen": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Convert": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NonConvert": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Lang1": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Lang2": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Lang3": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Lang4": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Lang5": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"NumpadParenLeft": {
"value": "(",
"withShift": "(",
"withAltGr": "(",
"withShiftAltGr": "("
},
"NumpadParenRight": {
"value": ")",
"withShift": ")",
"withAltGr": ")",
"withShiftAltGr": ")"
},
"ControlLeft": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ShiftLeft": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"AltLeft": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MetaLeft": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ControlRight": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"ShiftRight": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"AltRight": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MetaRight": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrightnessUp": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrightnessDown": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaPlay": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaRecord": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaFastForward": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaRewind": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaTrackNext": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaTrackPrevious": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaStop": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"Eject": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaPlayPause": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MediaSelect": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"LaunchMail": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"LaunchApp2": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"LaunchApp1": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"SelectTask": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"LaunchScreenSaver": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserSearch": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserHome": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserBack": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserForward": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserStop": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserRefresh": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"BrowserFavorites": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MailReply": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MailForward": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
},
"MailSend": {
"value": "",
"withShift": "",
"withAltGr": "",
"withShiftAltGr": ""
}
});
......@@ -1419,6 +1419,45 @@ suite('keyboardMapper - LINUX ru', () => {
});
});
suite('keyboardMapper - LINUX en_uk', () => {
let mapper: MacLinuxKeyboardMapper;
suiteSetup((done) => {
createKeyboardMapper(false, 'linux_en_uk', OperatingSystem.Linux).then((_mapper) => {
mapper = _mapper;
done();
}, done);
});
test('mapping', (done) => {
assertMapping(WRITE_FILE_IF_DIFFERENT, mapper, 'linux_en_uk.txt', done);
});
test('issue #24522: resolveKeyboardEvent Ctrl+Alt+[Minus]', () => {
assertResolveKeyboardEvent(
mapper,
{
ctrlKey: true,
shiftKey: false,
altKey: true,
metaKey: false,
keyCode: -1,
code: 'Minus'
},
{
label: 'Ctrl+Alt+-',
ariaLabel: 'Control+Alt+-',
electronAccelerator: null,
userSettingsLabel: 'ctrl+alt+[Minus]',
isWYSIWYG: false,
isChord: false,
dispatchParts: ['ctrl+alt+[Minus]', null],
}
);
});
});
function _assertKeybindingTranslation(mapper: MacLinuxKeyboardMapper, OS: OperatingSystem, kb: number, _expected: string | string[]): void {
let expected: string[];
if (typeof _expected === 'string') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册