mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 19:56:10 +01:00
This commit is contained in:
parent
cfe93a0acc
commit
275b4bb98c
2 changed files with 17 additions and 17 deletions
|
|
@ -42,7 +42,7 @@ import {deleteFiles} from "../../editor/deleteFile";
|
|||
import {escapeHtml} from "../../util/escape";
|
||||
import {syncGuide} from "../../sync/syncGuide";
|
||||
import {showPopover} from "../../block/popover";
|
||||
import {getStartEndElement} from "../../protyle/wysiwyg/commonHotkey";
|
||||
import {getStartEndElement, goEnd, goHome} from "../../protyle/wysiwyg/commonHotkey";
|
||||
import {getNextFileLi, getPreviousFileLi} from "../../protyle/wysiwyg/getBlock";
|
||||
import {editor} from "../../config/editor";
|
||||
import {hintMoveBlock} from "../../protyle/hint/extend";
|
||||
|
|
@ -400,6 +400,22 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
if (target.tagName !== "TABLE" && ["INPUT", "TEXTAREA"].includes(target.tagName)) {
|
||||
return false;
|
||||
}
|
||||
// ctrl+home 光标移动到顶
|
||||
if (!event.altKey && !event.shiftKey && isOnlyMeta(event) && event.key === "Home") {
|
||||
goHome(protyle);
|
||||
hideElements(["select"], protyle);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
// ctrl+end 光标移动到尾
|
||||
if (!event.altKey && !event.shiftKey && isOnlyMeta(event) && event.key === "End") {
|
||||
goEnd(protyle);
|
||||
hideElements(["select"], protyle);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.exitFocus.custom, event)) {
|
||||
event.preventDefault();
|
||||
zoomOut({protyle, id: protyle.block.rootID, focusId: protyle.block.id});
|
||||
|
|
|
|||
|
|
@ -500,22 +500,6 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
// ctrl+home 光标移动到顶
|
||||
if (!event.altKey && !event.shiftKey && isOnlyMeta(event) && event.key === "Home") {
|
||||
goHome(protyle);
|
||||
hideElements(["select"], protyle);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
// ctrl+end 光标移动到尾
|
||||
if (!event.altKey && !event.shiftKey && isOnlyMeta(event) && event.key === "End") {
|
||||
goEnd(protyle);
|
||||
hideElements(["select"], protyle);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
// 向上/下滚动一屏
|
||||
if (!event.altKey && !event.shiftKey && isNotCtrl(event) && (event.key === "PageUp" || event.key === "PageDown")) {
|
||||
if (event.key === "PageUp") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue