🐛 windows

This commit is contained in:
Vanessa 2023-11-16 11:22:37 +08:00 committed by Daniel
parent 43ec0a2997
commit 84b29657f8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 5 additions and 5 deletions

View file

@ -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;

View file

@ -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: {

View file

@ -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;
}
}