From f3b7f2e2f19870a3fd010d377d29ec6d7bf06a0f Mon Sep 17 00:00:00 2001 From: Cmen <1176967590@qq.com> Date: Mon, 7 Mar 2022 17:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E5=AD=97=E9=94=AE?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=BE=93=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/hotkeys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/hotkeys.ts b/src/utils/hotkeys.ts index 8e4c48d..4a99a61 100644 --- a/src/utils/hotkeys.ts +++ b/src/utils/hotkeys.ts @@ -18,8 +18,6 @@ window.onkeydown = function (e) { // console.log(key); if (listeners == null || listeners.length === 0) return; - e.stopPropagation(); - e.preventDefault(); // 异或操作. const xor = (a: boolean, b: boolean) => a !== b; @@ -30,6 +28,8 @@ window.onkeydown = function (e) { if (xor(shift, e.shiftKey)) return; if (xor(alt, e.altKey)) return; + e.stopPropagation(); + e.preventDefault(); callback(); }); };