diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-07-01 12:17:45 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-07-01 12:17:45 +0200 |
commit | e0bea044620eefc3deb4c5c52e43d097288e3b8e (patch) | |
tree | c5830d989b99206de8bf903d279c4149275f9da9 /pages | |
parent | 57178786647aa290f797871000ad6bbe5b83fb83 (diff) |
more keybinds
Diffstat (limited to 'pages')
-rw-r--r-- | pages/editor.tsx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx index c162e25..95085e1 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -690,7 +690,6 @@ function getMarkerSpacing() { if (spacing) break; multiply++; } - console.log(spacing); return spacing * multiply; } @@ -731,6 +730,19 @@ function TimelineEditor() { }); }, []); + useMousetrap(['.'], () => { // TODO: dry + if (!global.ready.timeline.value) return; + var frame = Math.min(project.timeline.framecount.value, global.timeline.frame.value + 1); + global.timeline.frame.set(frame); + scrubberSpring.start({ frame }); + }); + useMousetrap([','], () => { + if (!global.ready.timeline.value) return; + var frame = Math.max(0, global.timeline.frame.value - 1); + global.timeline.frame.set(frame); + scrubberSpring.start({ frame }); + }); + useEffect(() => { player.addEventListener('TimedVideoPlayerSlide', (event: CustomEvent) => { document.querySelectorAll('.keyframes .frame').forEach(el => { @@ -1312,6 +1324,17 @@ function Player() { player.registerPlayer(playerRef.current); }, []); + useMousetrap(['<'], () => { + if (!global.ready.timeline.value) return; + player.previous(); + }); + useMousetrap(['>'], () => { + if (!global.ready.timeline.value) return; + player.next(); // TODO: fix jank here + player.next(); + player.previous(); + }); + return <div className='viewer'> <div className={'player posrel ' + (ready.video.available.get() ? '' : 'disabled')}> <div className='outer posabs abscenter'> |