diff --git a/app/src/constants.ts b/app/src/constants.ts index 821f42367..24e5987d2 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -103,10 +103,12 @@ export abstract class Constants { "221": ["]", "}"], "222": ["'", '"'], }; + // 冲突不使用 "⌘S/Q" // "⌘", "⇧", "⌥", "⌃" // "⌘A", "⌘X", "⌘C", "⌘V", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦" 不可自定义 public static readonly SIYUAN_KEYMAP: IKeymap = { general: { + editMode: {default: "⌘.", custom: "⌘."}, syncNow: {default: "F9", custom: "F9"}, enterBack: {default: "⌥←", custom: "⌥←"}, enter: {default: "⌥→", custom: "⌥→"}, diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index d684bfa33..a331cde68 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -40,6 +40,7 @@ import {syncGuide} from "../sync/syncGuide"; import {showPopover} from "../block/popover"; import {getStartEndElement} from "../protyle/wysiwyg/commonHotkey"; import {getNextFileLi, getPreviousFileLi} from "../protyle/wysiwyg/getBlock"; +import {editor} from "../config/editor"; const getRightBlock = (element: HTMLElement, x: number, y: number) => { let index = 1; @@ -422,6 +423,12 @@ export const globalShortcut = () => { syncGuide(document.querySelector("#barSync")); return; } + if (matchHotKey(window.siyuan.config.keymap.general.editMode.custom, event)) { + event.preventDefault(); + event.stopPropagation(); + editor.setMode(); + return; + } if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) { exportLayout(false, () => { fetchPost("/api/system/logoutAuth", {}, () => { diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts index 037b91e9a..32f8f6d1c 100644 --- a/app/src/util/onGetConfig.ts +++ b/app/src/util/onGetConfig.ts @@ -182,7 +182,7 @@ const initBar = () => {
-