From d29174ca7688e23b2ffd56c18ff2986b2a0fedca Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 15 Jun 2024 11:20:34 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11720 --- app/src/config/keymap.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts index 0cf12e2619f..d46efe0db93 100644 --- a/app/src/config/keymap.ts +++ b/app/src/config/keymap.ts @@ -428,12 +428,15 @@ export const keymap = { keys[1] = "headings"; } let hasConflict = false; - if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) || + const isAssistKey = ["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) + if (isAssistKey || ["⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⌃D", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "Escape"].includes(keymapStr) || // 跳转到下/上一个编辑页签不能包含 ctrl, 否则不能监听到 keyup (isMac() && keys[0] === "general" && ["goToEditTabNext", "goToEditTabPrev"].includes(keys[1]) && keymapStr.includes("⌘")) ) { - showMessage(`${window.siyuan.languages.invalid} [${adoptKeymapStr}]`); + if (!isAssistKey) { + showMessage(`${window.siyuan.languages.invalid} [${adoptKeymapStr}]`); + } hasConflict = true; } Array.from(keymap.element.querySelectorAll("label.b3-list-item input")).find((inputItem: HTMLElement) => {