Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: windows

Vanessa84b29657f8de
diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts
index e97e14084c..d129a0a42c 100644
--- a/app/src/config/keymap.ts
+++ b/app/src/config/keymap.ts
@@ -382,9 +382,9 @@ export const keymap = {
}
let hasConflict = false;
if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) ||
- ["⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⌃D", "⌘⇥", "⇧⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr) ||
+ ["⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⌃D", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr) ||
// 跳转到下/上一个编辑页签不能包含 ctrl, 否则不能监听到 keyup
- (keys[0] === "general" && ["goToEditTabNext", "goToEditTabPrev"].includes(keys[1]) && keymapStr.includes("⌘"))
+ (isMac() && keys[0] === "general" && ["goToEditTabNext", "goToEditTabPrev"].includes(keys[1]) && keymapStr.includes("⌘"))
) {
showMessage(`${window.siyuan.languages.invalid} [${adoptKeymapStr}]`);
hasConflict = true;
diff --git a/app/src/constants.ts b/app/src/constants.ts
index f92f27ba83..08beb0e29f 100644
--- a/app/src/constants.ts
+++ b/app/src/constants.ts
@@ -221,7 +221,7 @@ export abstract class Constants {
};
// 冲突不使用 "⌘S/Q"
// "⌘", "⇧", "⌥", "⌃"
- // "⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⌃D", "⌘⇥", "⇧⌘⇥", "⇧⌘→", "⇧⌘←",
+ // "⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⌃D", "⇧⌘→", "⇧⌘←",
// "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦" 不可自定义
public static readonly SIYUAN_KEYMAP: IKeymap = {
general: {
diff --git a/app/src/protyle/util/hotKey.ts b/app/src/protyle/util/hotKey.ts
index 73433f12bb..86cc5166d9 100644
--- a/app/src/protyle/util/hotKey.ts
+++ b/app/src/protyle/util/hotKey.ts
@@ -8,7 +8,7 @@ export const matchAuxiliaryHotKey = (hotKey: string, event: KeyboardEvent) => {
return false;
}
} else {
- if (event.ctrlKey) {
+ if (isMac() ? event.ctrlKey : (hotKey.includes("⌘") ? !event.ctrlKey : event.ctrlKey)) {
return false;
}
}
@@ -35,7 +35,7 @@ export const matchAuxiliaryHotKey = (hotKey: string, event: KeyboardEvent) => {
return false;
}
} else {
- if (isMac() ? event.metaKey : event.ctrlKey) {
+ if (isMac() ? event.metaKey : (hotKey.includes("⌃") ? !event.ctrlKey : event.ctrlKey)) {
return false;
}
}