提交 030453f8 编写于 作者: A Alex Dima

Fixes #25871: Use latin letters for the UI for keyboard layouts that don't produce latin letters

上级 01344d13
......@@ -57,13 +57,6 @@ export function macLinuxKeyboardMappingEquals(a: IMacLinuxKeyboardMapping, b: IM
return true;
}
const LOG = false;
function log(str: string): void {
if (LOG) {
console.info(str);
}
}
/**
* A map from character to key codes.
* e.g. Contains entries such as:
......@@ -272,17 +265,6 @@ class ScanCodeKeyCodeMapper {
}
public registrationComplete(): void {
for (let i = 0; i < ScanCode.MAX_VALUE; i++) {
let base = (i << 3);
for (let j = 0; j < 8; j++) {
let actual = base + j;
let entry = this._scanCodeToKeyCode[actual];
if (typeof entry === 'undefined') {
log(`${ScanCodeUtils.toString(i)} - ${j.toString(2)} --- is missing`);
}
}
}
// IntlHash and IntlBackslash are rare keys, so ensure they don't end up being the preferred...
this._moveToEnd(ScanCode.IntlHash);
this._moveToEnd(ScanCode.IntlBackslash);
......@@ -512,6 +494,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
const _registerLetterIfMissing = (charCode: CharCode, scanCode: ScanCode, keyCode: KeyCode): void => {
if (!producesLetter[charCode]) {
_registerAllCombos(0, 0, 0, scanCode, keyCode);
this._scanCodeToLabel[scanCode] = String.fromCharCode(charCode);
}
};
......@@ -546,7 +529,6 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
if (rawMappings.hasOwnProperty(strScanCode)) {
const scanCode = ScanCodeUtils.toEnum(strScanCode);
if (scanCode === ScanCode.None) {
log(`Unknown ScanCode ${strScanCode} in mapping.`);
continue;
}
if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1) {
......
......@@ -1407,11 +1407,11 @@ suite('keyboardMapper - LINUX ru', () => {
_assertResolveKeybinding(
KeyMod.CtrlCmd | KeyCode.KEY_S,
[{
label: 'Ctrl+ы',
ariaLabel: 'Control+ы',
label: 'Ctrl+S',
ariaLabel: 'Control+S',
electronAccelerator: 'Ctrl+S',
userSettingsLabel: 'ctrl+s',
isWYSIWYG: false,
isWYSIWYG: true,
isChord: false,
dispatchParts: ['ctrl+[KeyS]', null],
}]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册