From 37d4dce4adb4e8740db85a69fe4883b387a98de0 Mon Sep 17 00:00:00 2001 From: csf Date: Mon, 25 Apr 2022 18:27:15 +0800 Subject: [PATCH] new input --- src/common.ts | 4 ++-- src/connection.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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")) {