From 6fbba411432348b99606006600de58de785399ac Mon Sep 17 00:00:00 2001 From: ssshooter Date: Thu, 26 Sep 2024 19:31:52 +0800 Subject: [PATCH] feat: add ctrl+x --- src/plugin/contextMenu.ts | 2 +- src/plugin/keypress.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugin/contextMenu.ts b/src/plugin/contextMenu.ts index f1d6faa2..0aa2055a 100644 --- a/src/plugin/contextMenu.ts +++ b/src/plugin/contextMenu.ts @@ -195,7 +195,7 @@ export default function (mind: MindElixirInstance, option: any) { mind.unselectNodes() } return () => { - // maybe usefull? + // maybe useful? add_child.onclick = null add_parent.onclick = null add_sibling.onclick = null diff --git a/src/plugin/keypress.ts b/src/plugin/keypress.ts index 67ce7e61..54c923d2 100644 --- a/src/plugin/keypress.ts +++ b/src/plugin/keypress.ts @@ -136,6 +136,13 @@ export default function (mind: MindElixirInstance) { else if (mind.currentNodes) mind.waitCopy = mind.currentNodes } }, + x: (e: KeyboardEvent) => { + if (e.metaKey || e.ctrlKey) { + if (mind.currentNode) mind.waitCopy = [mind.currentNode] + else if (mind.currentNodes) mind.waitCopy = mind.currentNodes + handleRemove() + } + }, v: (e: KeyboardEvent) => { if (!mind.waitCopy || !mind.currentNode) return if (e.metaKey || e.ctrlKey) {