diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts index 087f47b1e..3bc789369 100644 --- a/app/src/config/keymap.ts +++ b/app/src/config/keymap.ts @@ -268,7 +268,7 @@ export const keymap = { } if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) || - ["⌘S", "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌘↑", "⌘↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "F9"].includes(keymapStr)) { + ["⌘S", "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌘↑", "⌘↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) { showMessage(tip + "] " + window.siyuan.languages.invalid); return; } diff --git a/app/src/constants.ts b/app/src/constants.ts index b00684ab2..18eda9625 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -83,9 +83,10 @@ export abstract class Constants { }; // "⌘", "⇧", "⌥", "⌃" - // "⌘S", "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌘↑", "⌘↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "F9" 不可自定义 + // "⌘S", "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌘↑", "⌘↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦" 不可自定义 public static readonly SIYUAN_KEYMAP: IKeymap = { general: { + syncNow: {default: "F9", custom: "F9"}, enterBack: {default: "⌥←", custom: "⌥←"}, enter: {default: "⌥→", custom: "⌥→"}, goForward: {default: "⌘]", custom: "⌘]"}, diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 5cc326200..eeead8d07 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -353,7 +353,7 @@ export const globalShortcut = () => { return; } - if (event.key === "F9") { + if (event.key === window.siyuan.config.keymap.general.syncNow.custom) { if (needSubscribe() || document.querySelector("#barSync svg").classList.contains("fn__rotate")) { return; } diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts index c422557e7..2de03761f 100644 --- a/app/src/util/onGetConfig.ts +++ b/app/src/util/onGetConfig.ts @@ -182,7 +182,7 @@ const initBar = () => { -
+