diff --git a/app/src/protyle/wysiwyg/commonHotkey.ts b/app/src/protyle/wysiwyg/commonHotkey.ts index 02c63ab16..d1c771de6 100644 --- a/app/src/protyle/wysiwyg/commonHotkey.ts +++ b/app/src/protyle/wysiwyg/commonHotkey.ts @@ -36,20 +36,6 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => { return true; } - if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) { - reloadProtyle(protyle); - event.preventDefault(); - event.stopPropagation(); - return true; - } - - if (matchHotKey(window.siyuan.config.keymap.editor.general.fullscreen.custom, event)) { - fullscreen(protyle.element); - setPadding(protyle); - event.preventDefault(); - event.stopPropagation(); - return true; - } if (matchHotKey(window.siyuan.config.keymap.editor.general.netImg2LocalAsset.custom, event)) { netImg2LocalAssets(protyle); event.preventDefault(); diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 282fd855c..eb9775957 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -49,6 +49,9 @@ import {openHistory} from "../history/history"; import {openCard} from "../card/openCard"; import {lockScreen} from "../dialog/processSystem"; import {isWindow} from "./functions"; +import {reloadProtyle} from "../protyle/util/reload"; +import {fullscreen} from "../protyle/breadcrumb/action"; +import {setPadding} from "../protyle/ui/initUI"; const getRightBlock = (element: HTMLElement, x: number, y: number) => { let index = 1; @@ -1083,6 +1086,17 @@ const editKeydown = (event: KeyboardEvent) => { if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || hasClosestByAttribute(target, "contenteditable", null)) { return false; } + if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) { + reloadProtyle(protyle); + event.preventDefault(); + return true; + } + if (matchHotKey(window.siyuan.config.keymap.editor.general.fullscreen.custom, event)) { + fullscreen(protyle.element); + setPadding(protyle); + event.preventDefault(); + return true; + } if (matchHotKey(window.siyuan.config.keymap.editor.general.preview.custom, event)) { setEditMode(protyle, "preview"); event.preventDefault();