diff --git a/frontend/src/ts/input/handlers/keydown.ts b/frontend/src/ts/input/handlers/keydown.ts index 174e64c87..5c58faca7 100644 --- a/frontend/src/ts/input/handlers/keydown.ts +++ b/frontend/src/ts/input/handlers/keydown.ts @@ -24,6 +24,7 @@ import { getActiveFunboxNames, } from "../../test/funbox/list"; import * as TribeState from "../../tribe/tribe-state"; +import { CLIENT_STATE } from "../../tribe/types"; export async function handleTab(e: KeyboardEvent, now: number): Promise { if (Config.quickRestart === "tab") { @@ -145,7 +146,11 @@ async function handleFunboxes( } export async function onKeydown(event: KeyboardEvent): Promise { - if (!TribeState.isRaceActive()) { + if ( + TribeState.getState() === CLIENT_STATE.CONNECTED && + TribeState.isInARoom() && + !TribeState.isRaceActive() + ) { event.preventDefault(); return; }