mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-14 06:40:21 +00:00
Handle backtick earlier + Ignore commands when cmd/atl is pressed + prevent -0.0 as subtitle delay
This commit is contained in:
parent
375fb7fc24
commit
f90520d020
2 changed files with 9 additions and 2 deletions
|
|
@ -181,7 +181,11 @@ export function CaptionDelay(props: {
|
|||
setIsFocused(true);
|
||||
}}
|
||||
>
|
||||
{textTransformer(props.value.toFixed(props.decimalsAllowed ?? 0))}
|
||||
{textTransformer(
|
||||
props.value.toFixed(props.decimalsAllowed ?? 0) === "-0.0"
|
||||
? "0.0"
|
||||
: props.value.toFixed(props.decimalsAllowed ?? 0),
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ export function useGlobalKeyboardEvents() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Cancel if command or alt is pressed
|
||||
if (event.metaKey || event.altKey) return;
|
||||
|
||||
// Handle backtick (`) key hold for keyboard commands
|
||||
if (event.key === "`") {
|
||||
// Prevent default browser behavior (console opening in some browsers)
|
||||
|
|
@ -40,7 +43,7 @@ export function useGlobalKeyboardEvents() {
|
|||
// Show modal after 500ms hold
|
||||
holdTimeoutRef.current = setTimeout(() => {
|
||||
showKeyboardCommands();
|
||||
}, 500);
|
||||
}, 150);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue