mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 14:15:22 +03:00
Add up / down keyboard shortcut
This commit is contained in:
parent
3886064f33
commit
635f70df65
@ -139,6 +139,11 @@ export default function VideoControls({
|
|||||||
const onKeyboardShortcut = useCallback(
|
const onKeyboardShortcut = useCallback(
|
||||||
(key: string, down: boolean, repeat: boolean) => {
|
(key: string, down: boolean, repeat: boolean) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case "ArrowDown":
|
||||||
|
if (down) {
|
||||||
|
onSeek(-1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "ArrowLeft":
|
case "ArrowLeft":
|
||||||
if (down) {
|
if (down) {
|
||||||
onSeek(-10);
|
onSeek(-10);
|
||||||
@ -149,6 +154,11 @@ export default function VideoControls({
|
|||||||
onSeek(10);
|
onSeek(10);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "ArrowUp":
|
||||||
|
if (down) {
|
||||||
|
onSeek(1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "f":
|
case "f":
|
||||||
if (setFullscreen && down && !repeat) {
|
if (setFullscreen && down && !repeat) {
|
||||||
setFullscreen(!fullscreen);
|
setFullscreen(!fullscreen);
|
||||||
@ -171,7 +181,9 @@ export default function VideoControls({
|
|||||||
[video, isPlaying, fullscreen, setFullscreen, onSeek],
|
[video, isPlaying, fullscreen, setFullscreen, onSeek],
|
||||||
);
|
);
|
||||||
useKeyboardListener(
|
useKeyboardListener(
|
||||||
hotKeys ? ["ArrowLeft", "ArrowRight", "f", "m", " "] : [],
|
hotKeys
|
||||||
|
? ["ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "f", "m", " "]
|
||||||
|
: [],
|
||||||
onKeyboardShortcut,
|
onKeyboardShortcut,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user