aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-07-01 12:17:45 +0200
committerlonkaars <loek@pipeframe.xyz>2021-07-01 12:17:45 +0200
commite0bea044620eefc3deb4c5c52e43d097288e3b8e (patch)
treec5830d989b99206de8bf903d279c4149275f9da9 /pages
parent57178786647aa290f797871000ad6bbe5b83fb83 (diff)
more keybinds
Diffstat (limited to 'pages')
-rw-r--r--pages/editor.tsx25
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'>