diff --git a/src/common.ts b/src/common.ts index 511f7e044..8da049a4d 100644 --- a/src/common.ts +++ b/src/common.ts @@ -55,9 +55,9 @@ export function mapKey(name: string, isDesktop: Boolean) { return KeyEvent.fromPartial({ unicode: chr }); else return KeyEvent.fromPartial({ chr }); } - const control_key = controlKeyFromJSON(name); + const control_key = controlKeyFromJSON(tmp); if (control_key == ControlKey.UNRECOGNIZED) { - console.error("Unknown control key " + name); + console.error("Unknown control key " + tmp); } return KeyEvent.fromPartial({ control_key }); } diff --git a/src/connection.ts b/src/connection.ts index 43abcab64..2846d9078 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -563,13 +563,13 @@ export default class Connection { ) { const key_event = mapKey(name, globals.isDesktop()); if (!key_event) return; - if (alt && (name == "Alt" || name == "RAlt")) { + if (alt && (name == "VK_MENU" || name == "RAlt")) { alt = false; } - if (ctrl && (name == "Control" || name == "RControl")) { + if (ctrl && (name == "VK_CONTROL" || name == "RControl")) { ctrl = false; } - if (shift && (name == "Shift" || name == "RShift")) { + if (shift && (name == "VK_SHIFT" || name == "RShift")) { shift = false; } if (command && (name == "Meta" || name == "RWin")) {