This commit is contained in:
Vanessa 2022-07-09 09:14:05 +08:00
parent 086e2ffbd0
commit 02c7182856
4 changed files with 5 additions and 4 deletions

View File

@ -268,7 +268,7 @@ export const keymap = {
} }
if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) || 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); showMessage(tip + "] " + window.siyuan.languages.invalid);
return; return;
} }

View File

@ -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 = { public static readonly SIYUAN_KEYMAP: IKeymap = {
general: { general: {
syncNow: {default: "F9", custom: "F9"},
enterBack: {default: "⌥←", custom: "⌥←"}, enterBack: {default: "⌥←", custom: "⌥←"},
enter: {default: "⌥→", custom: "⌥→"}, enter: {default: "⌥→", custom: "⌥→"},
goForward: {default: "⌘]", custom: "⌘]"}, goForward: {default: "⌘]", custom: "⌘]"},

View File

@ -353,7 +353,7 @@ export const globalShortcut = () => {
return; 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")) { if (needSubscribe() || document.querySelector("#barSync svg").classList.contains("fn__rotate")) {
return; return;
} }

View File

@ -182,7 +182,7 @@ const initBar = () => {
<use xlink:href="#iconSettings"></use> <use xlink:href="#iconSettings"></use>
</svg> </svg>
</div> </div>
<div id="barSync" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.config.sync.stat || (window.siyuan.languages.syncNow + " F9")}"> <div id="barSync" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.config.sync.stat || (window.siyuan.languages.syncNow + " " + updateHotkeyTip(window.siyuan.config.keymap.general.syncNow.custom))}">
<svg><use xlink:href="#iconRefresh"></use></svg> <svg><use xlink:href="#iconRefresh"></use></svg>
</div> </div>
<button id="barBack" data-menu="true" class="toolbar__item toolbar__item--disabled b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.goBack} ${updateHotkeyTip(window.siyuan.config.keymap.general.goBack.custom)}"> <button id="barBack" data-menu="true" class="toolbar__item toolbar__item--disabled b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.goBack} ${updateHotkeyTip(window.siyuan.config.keymap.general.goBack.custom)}">