disable 0-9 keyboard shortcuts when ctrl or meta is held

This commit is contained in:
Pas 2025-11-07 15:44:06 -07:00
parent c6873907ef
commit 09f48baefa

View file

@ -265,7 +265,12 @@ export function KeyboardEvents() {
dataRef.current.display?.setTime(dataRef.current.time - 1);
// Skip to percentage with number keys (0-9)
if (/^[0-9]$/.test(k) && dataRef.current.duration > 0) {
if (
/^[0-9]$/.test(k) &&
dataRef.current.duration > 0 &&
!evt.ctrlKey &&
!evt.metaKey
) {
const percentage = parseInt(k, 10) * 10; // 0 = 0%, 1 = 10%, 2 = 20%, ..., 9 = 90%
const targetTime = (dataRef.current.duration * percentage) / 100;
dataRef.current.display?.setTime(targetTime);