MCPcopy Create free account
hub / github.com/experdot/pointer / handleKeyDown

Function handleKeyDown

src/renderer/src/components/common/ImageEditor.tsx:124–132  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

122 // 键盘快捷键
123 useEffect(() => {
124 const handleKeyDown = (e: KeyboardEvent) => {
125 if ((e.ctrlKey || e.metaKey) && e.key === 'z') {
126 e.preventDefault()
127 undo()
128 } else if ((e.ctrlKey || e.metaKey) && e.key === 'y') {
129 e.preventDefault()
130 redo()
131 }
132 }
133
134 window.addEventListener('keydown', handleKeyDown)
135 return () => {

Callers

nothing calls this directly

Calls 2

undoFunction · 0.85
redoFunction · 0.85

Tested by

no test coverage detected