diff options
| author | gantiro <gantiro396@gmail.com> | 2025-07-16 20:53:00 +0700 |
|---|---|---|
| committer | gantiro <gantiro396@gmail.com> | 2025-07-16 20:53:00 +0700 |
| commit | 955f6331f258143daa62cb6e004c6df089c55c64 (patch) | |
| tree | f1e4ed03cbfb35408ae5282dfe35371e535e5eb8 /apps/web/src/hooks/use-playback-controls.ts | |
| parent | 2974fd89a942f4e3173642b165f228e2af604ae7 (diff) | |
| parent | 3371a6889634f326063351295faca9a56c566706 (diff) | |
| download | opencut-955f6331f258143daa62cb6e004c6df089c55c64.tar.gz | |
Merge branch 'main' into feature/optimize-timeline-ruler
Diffstat (limited to 'apps/web/src/hooks/use-playback-controls.ts')
| -rw-r--r-- | apps/web/src/hooks/use-playback-controls.ts | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/apps/web/src/hooks/use-playback-controls.ts b/apps/web/src/hooks/use-playback-controls.ts index 1191d4b4..ecbd1232 100644 --- a/apps/web/src/hooks/use-playback-controls.ts +++ b/apps/web/src/hooks/use-playback-controls.ts @@ -106,68 +106,4 @@ export const usePlaybackControls = () => { separateAudio(trackId, elementId); }, [selectedElements, tracks, separateAudio]); - - const handleKeyPress = useCallback( - (e: KeyboardEvent) => { - if ( - e.target instanceof HTMLInputElement || - e.target instanceof HTMLTextAreaElement - ) { - return; - } - - switch (e.key) { - case " ": - e.preventDefault(); - if (isPlaying) { - pause(); - } else { - play(); - } - break; - - case "s": - if (e.ctrlKey || e.metaKey) { - e.preventDefault(); - handleSplitSelectedElement(); - } - break; - - case "q": - if (e.ctrlKey || e.metaKey) { - e.preventDefault(); - handleSplitAndKeepLeftCallback(); - } - break; - - case "w": - if (e.ctrlKey || e.metaKey) { - e.preventDefault(); - handleSplitAndKeepRightCallback(); - } - break; - - case "d": - if (e.ctrlKey || e.metaKey) { - e.preventDefault(); - handleSeparateAudioCallback(); - } - break; - } - }, - [ - isPlaying, - play, - pause, - handleSplitSelectedElement, - handleSplitAndKeepLeftCallback, - handleSplitAndKeepRightCallback, - handleSeparateAudioCallback, - ] - ); - - useEffect(() => { - document.addEventListener("keydown", handleKeyPress); - return () => document.removeEventListener("keydown", handleKeyPress); - }, [handleKeyPress]); }; |
