diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-13 04:40:56 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-13 05:03:10 +0200 |
| commit | 2272598d420cf078aaa3928246bfa3a414f6eddb (patch) | |
| tree | b52460a2e3576c9e517ef8a9dd86959a68f31b69 /apps/web/src/hooks/use-keybindings.ts | |
| parent | 5a2aaf3601b6b050603f51e487a31fb07862a21f (diff) | |
| download | opencut-2272598d420cf078aaa3928246bfa3a414f6eddb.tar.gz | |
feat: clipboard with keyframe paste
Made-with: Cursor
Diffstat (limited to 'apps/web/src/hooks/use-keybindings.ts')
| -rw-r--r-- | apps/web/src/hooks/use-keybindings.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/web/src/hooks/use-keybindings.ts b/apps/web/src/hooks/use-keybindings.ts index 69a4e847..3f96c340 100644 --- a/apps/web/src/hooks/use-keybindings.ts +++ b/apps/web/src/hooks/use-keybindings.ts @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { invokeAction } from "@/lib/actions"; +import { useEditor } from "@/hooks/use-editor"; import { useKeybindingsStore } from "@/stores/keybindings-store"; -import { useTimelineStore } from "@/stores/timeline-store"; import { isTypableDOMElement } from "@/utils/browser"; /** @@ -10,6 +10,7 @@ import { isTypableDOMElement } from "@/utils/browser"; * the appropriate actions based on keybindings */ export function useKeybindingsListener() { + const editor = useEditor(); const { keybindings, getKeybindingString, @@ -17,7 +18,6 @@ export function useKeybindingsListener() { isLoadingProject, isRecording, } = useKeybindingsStore(); - const clipboard = useTimelineStore((state) => state.clipboard); useEffect(() => { const eventOptions: AddEventListenerOptions = { capture: true }; @@ -140,7 +140,7 @@ export function useKeybindingsListener() { if (isTextInput) return; if (boundAction === "paste-copied") { - if (!clipboard?.items.length) return; + if (!editor.clipboard.hasEntry()) return; ev.preventDefault(); invokeAction("paste-copied", undefined, "keypress"); return; @@ -177,6 +177,6 @@ export function useKeybindingsListener() { overlayDepth, isLoadingProject, isRecording, - clipboard, + editor, ]); } |
