Prevent mute event spam from key repeats

This commit is contained in:
David Baker 2023-01-12 18:26:21 +00:00
parent 9ba4ce429f
commit f2193302c1

View File

@ -43,13 +43,14 @@ export function useKeyboardShortcuts(
toggleMicrophoneMuted();
} else if (event.key == "v") {
toggleLocalVideoMuted();
} else if (event.key === " ") {
} else if (event.key === " " && !spacebarHeld) {
setSpacebarHeld(true);
setMicrophoneMuted(false);
}
},
[
enabled,
spacebarHeld,
toggleLocalVideoMuted,
toggleMicrophoneMuted,
setMicrophoneMuted,