From 597d440947a213f24d1db2fc32b8fbe76c17a120 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 2 Sep 2022 13:19:26 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E8=A1=A8=E6=A0=BC=E5=86=85=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E4=BB=A3=E7=A0=81=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/config/keymap.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts index 4b5ad9c0d..f17d016ec 100644 --- a/app/src/config/keymap.ts +++ b/app/src/config/keymap.ts @@ -246,13 +246,26 @@ export const keymap = { this.value = ""; }); } + } else if (event.key === "》") { + keymapStr += ">"; + } else if (event.key === "《") { + keymapStr += "<"; + } else if (event.key === "—") { + keymapStr += "-"; } else { keymapStr += event.key.length > 1 ? event.key : event.key.toUpperCase(); } } this.setAttribute("data-value", keymapStr); - this.value = updateHotkeyTip(keymapStr); + if (event.key === "—") { + // Mac 中文下会添加"——" + setTimeout(() => { + this.value = updateHotkeyTip(keymapStr); + }); + } else { + this.value = updateHotkeyTip(keymapStr); + } clearTimeout(timeout); timeout = window.setTimeout(() => { const keys = this.getAttribute("data-key").split(Constants.ZWSP);