summaryrefslogtreecommitdiff
path: root/apps/web/src/hooks/use-playback-controls.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-07-16 14:37:08 +0200
committerMaze Winther <mazewinther@gmail.com>2025-07-16 14:37:08 +0200
commit8bc26539ebe44d6ff0d74d86ef316934c7f18faf (patch)
treeaab9487ca4a44a5d9f12b3b2b6718bc28d01a303 /apps/web/src/hooks/use-playback-controls.ts
parent527d5888974f64abc33dfd7af4ec4dc7d2eb293c (diff)
downloadopencut-8bc26539ebe44d6ff0d74d86ef316934c7f18faf.tar.gz
cleanup (this doesn't work)
Diffstat (limited to 'apps/web/src/hooks/use-playback-controls.ts')
-rw-r--r--apps/web/src/hooks/use-playback-controls.ts64
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]);
};