feat(shortcut): h/a/d

This commit is contained in:
zhangheng
2026-04-03 17:00:09 +08:00
parent b6ae2a6a29
commit bb727d52be
7 changed files with 449 additions and 83 deletions

View File

@@ -87,6 +87,7 @@ import {
import { useBackUrlStore, usePermissionStore } from "../store/auth"
import { useBottomToolsStore } from "../useBottomToolsStore"
import { useDescToolsStore } from "../useDescToolsStore"
import { useKeyboardStore } from "../useKeyBoardStore"
import { usePaperStore } from "../usePaperStore"
import { useRightToolsStore } from "../useRightToolsStore"
import { useIntervalStore, useLabelTimeStore } from "../useTimerStore"
@@ -1531,6 +1532,7 @@ const TopTools = (
}, [activeOperation, mode])
const operationSchema = getOperationSchema(activeOperation)
const drawAction = useKeyboardStore((state) => state.drawAction)
const subAttrForm = (
<Box w={256}>
@@ -1645,6 +1647,12 @@ const TopTools = (
const iconStyle = { width: 20, height: 20 }
if (mode === "support") return <Paintbrush style={iconStyle} />
if (editMode) {
if (pressA && drawAction === "subtract") {
return <CopyMinus style={iconStyle} />
}
if (pressA && drawAction === "add") {
return <CopyPlus style={iconStyle} />
}
return pressA ? (
<CirclePlus style={iconStyle} />
) : (
@@ -1653,7 +1661,7 @@ const TopTools = (
} else {
return <MousePointer style={iconStyle} />
}
}, [mode, editMode, pressA])
}, [mode, editMode, pressA, drawAction])
const showTagConfigContainer = useMemo(() => {
const configs = ["ID", "类别", "外框", "点ID", "子属性", "属性值"]