Live map of KeyboardEvent.code → pressed state. Codes only appear after the key has been touched at least once; missing codes read as undefined (use isPressed for a safe boolean).
true when code is currently held. Safe for untouched keys (returns false rather than undefined).
Mark every tracked key as released. Called automatically on window blur and on gameloopStopped.
Mark a single key as released — used to consume a press so subsequent ticks don't re-trigger one-shot actions while the key is still held.
Keyboard state. Wired into
Gameautomatically. The preferred way to consume input is to poll isPressed fromupdate— game input is held-state-based ("is W held this frame?"), and combining with stopPress handles one-shot actions cleanly. The EventSystem"inputKeyboard"event (payload:(keys, code, pressed)) is available for cases that genuinely need edge-triggered handling.State is cleared on
windowblur and ongameloopStoppedso held keys don't stay "pressed" when focus or the loop is lost. InSettings.debugmode, pressing Escape stops the gameloop.