mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 09:02:15 +03:00
Make keyboard shortcuts consistent (#20326)
* Make keyboard shortcuts consistent * Cleanup * Refactor prevent default to not require separate input * Fix * Implement escape for reviews * Implement escape for explore * Send content ref to get page changes for free
This commit is contained in:
@@ -60,7 +60,7 @@ export function GenericVideoPlayer({
|
||||
["ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", " ", "f", "m"],
|
||||
(key, modifiers) => {
|
||||
if (!modifiers.down || modifiers.repeat) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
@@ -92,6 +92,8 @@ export function GenericVideoPlayer({
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ export default function VideoControls({
|
||||
const onKeyboardShortcut = useCallback(
|
||||
(key: string | null, modifiers: KeyModifiers) => {
|
||||
if (!modifiers.down) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
@@ -174,6 +174,8 @@ export default function VideoControls({
|
||||
onPlayPause(!isPlaying);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
// only update when preview only changes
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
Reference in New Issue
Block a user