Skip to content

Commit 124c0a9

Browse files
committed
feat(editor2): remove hotkey for adding action
1 parent 3f2a378 commit 124c0a9

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/components/editor2/action/ActionEditor.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { SortableContext } from '@dnd-kit/sortable'
1212
import clsx from 'clsx'
1313
import { useAtomValue, useSetAtom } from 'jotai'
1414
import { selectAtom, useAtomCallback } from 'jotai/utils'
15-
import { FC, useCallback, useEffect, useRef } from 'react'
15+
import { FC, useCallback, useRef } from 'react'
1616

1717
import { i18n, useTranslation } from '../../../i18n/i18n'
1818
import { Sortable } from '../../dnd'
@@ -77,27 +77,6 @@ export const ActionEditor: FC<ActionEditorProps> = ({ className }) => {
7777
),
7878
)
7979

80-
useEffect(() => {
81-
let mouseX = 0
82-
let mouseY = 0
83-
const onMouseMove = (e: MouseEvent) => {
84-
mouseX = e.clientX
85-
mouseY = e.clientY
86-
}
87-
const onKeyDown = (e: KeyboardEvent) => {
88-
if (e.code === 'KeyA' && e.shiftKey) {
89-
createActionMenuRef.current?.open(mouseX, mouseY)
90-
e.preventDefault()
91-
}
92-
}
93-
document.addEventListener('mousemove', onMouseMove)
94-
document.addEventListener('keydown', onKeyDown)
95-
return () => {
96-
document.removeEventListener('mousemove', onMouseMove)
97-
document.removeEventListener('keydown', onKeyDown)
98-
}
99-
}, [])
100-
10180
return (
10281
<div
10382
className={clsx('px-4 grow min-h-0 pb-96', className)}

src/i18n/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@
635635
"en": "Action Sequence"
636636
},
637637
"add_action": {
638-
"cn": "添加动作 (Shift + A)",
639-
"en": "Add Action (Shift + A)"
638+
"cn": "添加动作",
639+
"en": "Add Action"
640640
},
641641
"move_action": {
642642
"cn": "移动动作",

0 commit comments

Comments
 (0)