Skip to content

Commit

Permalink
🎨 fix #5376
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jul 9, 2022
1 parent 086e2ff commit 02c7182
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/config/keymap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "⌘]"},
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/globalShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/util/onGetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const initBar = () => {
<use xlink:href="#iconSettings"></use>
</svg>
</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>
</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)}">
Expand Down

0 comments on commit 02c7182

Please sign in to comment.