From 09cde5cc04458c9b94560634a0c61c1deb21947d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 8 Oct 2022 14:58:22 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/6093 --- app/src/protyle/util/hotKey.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/util/hotKey.ts b/app/src/protyle/util/hotKey.ts index 8ac0c1fec..9f50ff282 100644 --- a/app/src/protyle/util/hotKey.ts +++ b/app/src/protyle/util/hotKey.ts @@ -45,13 +45,15 @@ export const matchHotKey = (hotKey: string, event: KeyboardEvent) => { } // 是否匹配 ⇧[] - if (hotKey.startsWith("⇧") && hotKeys.length === 2 && !event.ctrlKey && !isCtrl(event) && !event.altKey && event.shiftKey) { - if (event.code.startsWith("Digit") || event.code.startsWith("Numpad")) { - if (hotKeys[1] === event.code.slice(-1)) { + if (hotKey.startsWith("⇧") && hotKeys.length === 2) { + if (!event.ctrlKey && !isCtrl(event) && !event.altKey && event.shiftKey) { + if (event.code.startsWith("Digit") || event.code.startsWith("Numpad")) { + if (hotKeys[1] === event.code.slice(-1)) { + return true; + } + } else if (event.key === hotKeys[1]) { return true; } - } else if (event.key === hotKeys[1]) { - return true; } return false; }