From c9baa2d9dca77eeda1cf4c837d42af92a4f7b688 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 12 Jan 2023 18:26:21 +0000 Subject: [PATCH] Prevent mute event spam from key repeats --- src/useKeyboardShortcuts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/useKeyboardShortcuts.ts b/src/useKeyboardShortcuts.ts index b9d69ec8..6356b525 100644 --- a/src/useKeyboardShortcuts.ts +++ b/src/useKeyboardShortcuts.ts @@ -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,