Skip to content

InputManager

Defined in: InputManager.ts:144

Central input state manager. Resolved via DI with InputManagerKey.

new InputManager(): InputManager

InputManager

_advanceTime(dtMs): void

Defined in: InputManager.ts:2622

Internal

Advance the elapsed game-time clock. Called by InputPollSystem.

number

void


_applyKeyDown(code): void

Defined in: InputManager.ts:2309

Internal

Synthetic key-down. DOM-originated events must use _enqueueKeyDown so consumePointer and the UI hit-test fallback have a chance to run before action edges fire.

string

void


_applyKeyUp(code): void

Defined in: InputManager.ts:2335

Internal

Synthetic key-up. DOM-originated events must use _enqueueKeyUp.

string

void


_applyPointerCancel(id): void

Defined in: InputManager.ts:2404

Internal

Synthetic pointer cancel. Clears all buttons on the pointer, fires up-listeners, and drops the entry (unless it’s a mouse). Mirrors the drain-time drainPointerCancel logic.

number

void


_applyPointerDown(info): void

Defined in: InputManager.ts:2365

Internal

Synthetic pointer down. DOM-originated events must use _enqueuePointerDown. This applies all state (button mutation, mouse-aggregate emit, listener notify) synchronously.

PointerEventInfo

void


_applyPointerMove(info): void

Defined in: InputManager.ts:2354

Internal

Synthetic pointer move. DOM-originated events must use _enqueuePointerMove.

PointerEventInfo

void


_applyPointerUp(info): void

Defined in: InputManager.ts:2382

Internal

Synthetic pointer up. DOM-originated events must use _enqueuePointerUp.

PointerEventInfo

void


_clearFrameState(): void

Defined in: InputManager.ts:2559

Internal

End-of-frame reset: clear per-frame edge flags and snapshot per-action holds for the next frame’s crossing tests.

void


_drainInputQueue(): void

Defined in: InputManager.ts:2185

Internal

Drain queued DOM events at Phase.EarlyUpdate. Each event applies its deferred state (button mutations, action-map edges, mouse-aggregate transitions). Consumed pointers are excluded from the mouse aggregate so UI-claimed presses do not propagate to gameplay actions. The renderer’s optional hitTestUI(x, y) auto-claims a pointer whose pointerdown lands on a UI-marked container.

void


_enqueueKeyDown(code): void

Defined in: InputManager.ts:2109

Internal

string

void


_enqueueKeyUp(code): void

Defined in: InputManager.ts:2114

Internal

string

void


_enqueuePointerCancel(id): void

Defined in: InputManager.ts:2162

Internal

number

void


_enqueuePointerDown(info): void

Defined in: InputManager.ts:2146

Internal

Sync portion: upsert pointer (existence, screenPos, type, isPrimary, primaryPointerId) and notify pointerDownListeners. Button mutation, action-map edges, and mouse-aggregate emit are deferred to the next drain at Phase.EarlyUpdate so consumePointer (or the renderer’s UI hit-test) can suppress them, AND so a same-frame down+up that arrives before drain still produces the correct MouseLeft press/release edges (recomputing aggregate from live state after sync mutation would silently drop the transient transition).

Listeners therefore observe pointer.buttons BEFORE this event’s edge is applied — buttons does not yet include the button just pressed. To filter by button in an onPointerDown listener, read info.button (the triggering edge, threaded through to PointerInfo.button), not info.buttons.

PointerEventInfo

void


_enqueuePointerMove(info): void

Defined in: InputManager.ts:2124

Internal

Sync portion: upsert the pointer entry (existence, screenPos, type, isPrimary, primaryPointerId) and notify pointerMoveListeners so pointer-tracking UIs see live cursor positions. Move events do not carry action-map edges, so they are not queued.

PointerEventInfo

void


_enqueuePointerUp(info): void

Defined in: InputManager.ts:2154

Internal

PointerEventInfo

void


_enqueueWheel(dx, dy): void

Defined in: InputManager.ts:2171

Internal

number

number

void


_onGamepadConnected(info): void

Defined in: InputManager.ts:1622

Internal

Called by InputPlugin from gamepadconnected event or by polling when discovering a previously-unknown pad. Idempotent.

GamepadInfo

void


_onGamepadDisconnected(info): void

Defined in: InputManager.ts:1640

Internal

Called by InputPlugin from gamepaddisconnected event or by polling when a pad vanishes silently. Idempotent.

GamepadInfo

void


_onKeyDown(code): void

Defined in: InputManager.ts:2629

Internal

Sync alias — see _applyKeyDown.

string

void


_onKeyUp(code): void

Defined in: InputManager.ts:2633

Internal

Sync alias — see _applyKeyUp.

string

void


_onPointerCancel(id): void

Defined in: InputManager.ts:2649

Internal

Sync alias — see _applyPointerCancel.

number

void


_onPointerDown(info): void

Defined in: InputManager.ts:2641

Internal

Sync alias — see _applyPointerDown.

PointerEventInfo

void


_onPointerMove(info): void

Defined in: InputManager.ts:2637

Internal

Sync alias — see _applyPointerMove.

PointerEventInfo

void


_onPointerUp(info): void

Defined in: InputManager.ts:2645

Internal

Sync alias — see _applyPointerUp.

PointerEventInfo

void


_pollGamepads(): void

Defined in: InputManager.ts:1680

Internal

Poll real gamepads via navigator.getGamepads() and emit key-down/key-up edges for any aggregate state changes. Called by InputPollSystem once per frame.

void


_registerClock(clock): void

Defined in: InputManager.ts:721

Internal

Register a clock so press edges and hold starts capture its current reading. Input already held is stamped at registration, so an ongoing hold starts from zero on the new clock instead of reading as not held. A press made before registration is not backfilled — it happened outside this clock’s timeline.

InputClock

void


_releaseAllGamepadState(): void

Defined in: InputManager.ts:1611

Internal

Force-release held gamepad buttons and clear real-pad analog snapshots. Used on tab-hide (where navigator.getGamepads() returns stale data) and on disconnect when polling is paused. Synthetic axes live in their own field, so they’re untouched.

void


_setErrorBoundary(boundary): void

Defined in: InputManager.ts:2094

Internal

Wire the error boundary so a throwing key/action listener is attributed and reported. Called by InputPlugin.install.

ErrorBoundary | undefined

void


_setRenderer(renderer): void

Defined in: InputManager.ts:2086

Internal

Stash the renderer adapter so the drain step can call its optional hitTestUI(x, y) for the auto-consume fallback. Called by InputPlugin.install.

RendererAdapter | null

void


_setScheduler(scheduler): void

Defined in: InputManager.ts:2104

Internal

Wire the scheduler so edge queries can resolve the caller’s execution context (phase and fixed step). Called by InputPlugin.registerSystems. When never wired (standalone manager), every query resolves against the frame window.

SchedulerLike

void


_unregisterClock(clock): void

Defined in: InputManager.ts:737

Internal

Drop a clock and everything measured on it.

InputClock

void


bindKey(action, key): void

Defined in: InputManager.ts:1078

Add a key binding to an action. Creates the action if it doesn’t exist.

string

string

void


cancelListen(): void

Defined in: InputManager.ts:1288

Cancel an active listenForNextKey. Resolves the pending promise with null.

void


clearAll(): void

Defined in: InputManager.ts:1952

Release all synthetic and physical input state.

void


clearCamera(): void

Defined in: InputManager.ts:2612

Clear the camera reference (e.g. on scene exit).

void


clearPointerButtons(): void

Defined in: InputManager.ts:1997

Drop all tracked pointers and release the aggregate MouseLeft/Middle/Right codes without touching keyboard or gamepad state. Useful for window-blur / page-hide handling.

void


consumeBufferedPress(action, windowSeconds, options?): boolean

Defined in: InputManager.ts:682

Consuming buffered-press query: true if the action was pressed within the last windowSeconds and that press has not yet been claimed. Claims the press on success, so it returns true at most once per press; only a new press clears the claim (last-press-wins, no queue). Consumption is scoped to this query — isJustPressed and action listeners still see every press.

Lets a consumer act on a press up to windowSeconds late (e.g. jump buffered just before landing) without the press re-triggering later.

The window counts on the raw input clock (getClockTime), which ignores scene pause and time scale. Pass options.clock — the SceneTime of a scene on the stack — to count it on that scene’s simulation time instead; any other clock throws. One press is claimed once whichever clock measured it.

A disabled action returns false without claiming, so a discard-on-resume call has to run with the action enabled to drop a press buffered earlier.

string

number

BufferedPressOptions

boolean


consumePointer(id): void

Defined in: InputManager.ts:941

Mark a pointer as claimed for the rest of its event cycle (down → up). Subsequent action-map edges for this pointer (e.g. the MouseLeft edge a pointerdown would normally fire) are suppressed; onPointerDown/Up/Move listeners still fire because they are explicit user opt-ins.

Two cases use this:

  1. A UI handler claims a real event. Call from a Pixi pointerdown handler that wants to own the event: manager.consumePointer(e.pointerId).

  2. You forwarded or replayed a synthetic pointer to the canvas and need it kept out of gameplay actions. A DOM overlay above the canvas (virtual joystick, accessibility overlay, input-replay tooling) that dispatches a synthetic PointerEvent to the canvas — so listeners underneath still receive it — must pair the dispatch with consumePointer or every forwarded tap leaks into the MouseLeft/Middle/Right action edge:

    canvas.dispatchEvent(syntheticPointerDown); // underneath listeners still fire
    input.consumePointer(e.pointerId); // but no gameplay action edge

The mark clears automatically when the pointer’s last button releases or on pointercancel.

number

void


consumeWheel(): void

Defined in: InputManager.ts:954

Suppress wheel action-map edges (WheelUp/Down/Left/Right) for the rest of the current frame. onWheel listeners still fire.

void


disableGroup(name): void

Defined in: InputManager.ts:1237

Disable a group by name. Actions only in disabled groups become inactive.

string

void


enableGroup(name): void

Defined in: InputManager.ts:1232

Enable a group by name.

string

void


exportBindings(): ActionMapDefinition

Defined in: InputManager.ts:1196

Export the current bindings as a plain object for serialization.

ActionMapDefinition


fireAction(name): void

Defined in: InputManager.ts:1853

Inject a one-frame synthetic action pulse.

string

void


fireActionDown(name): void

Defined in: InputManager.ts:1884

Begin a sustained synthetic press on an action by name. Unlike fireAction (a one-frame pulse), the press persists across frames until fireActionUp, so isPressed stays true, getHoldDuration accrues, and a real release edge fires later. Symmetric to the physical-key path (fireKeyDown) but keyed by action, so synthetic devices (touch, virtual controls) drive hold and charge actions with no keymap knowledge.

Idempotent: re-calling while already held does not reset the hold start or re-fire the press edge. Throws on an unknown action name.

string

void


fireActionUp(name): void

Defined in: InputManager.ts:1912

Release a sustained synthetic press started by fireActionDown. Emits a one-frame isJustReleased edge and fires onActionReleased. No-op if the action is not currently held. Throws on an unknown action name.

string

void


fireGamepadAxis(side, value): void

Defined in: InputManager.ts:1413

Inject a synthetic gamepad axis value. Stored separately from real-pad axis state and consulted by getStick / getTrigger when no real pad is active, or when the active pad’s own input rests inside the deadzone — so test fixtures and virtual sticks read back even while an idle controller sits plugged in; a pad deflected past the deadzone wins.

Trigger axes additionally emit GamepadLT/GamepadRT button edges when crossing triggerThreshold, mirroring real-pad polling so synthetic inspector probes drive isPressed the same way as physical hardware.

GamepadAxisKey

number

void


fireGamepadButton(code, pressed): void

Defined in: InputManager.ts:1391

Inject a synthetic gamepad button edge. Routes through the same internal path as real polling, so action queries (isPressed, isJustPressed), listenForNextKey, and rebinding all see the synthetic input.

code should be a gamepad code string (e.g. "GamepadA", "GamepadLT"). Used by inspector probes / deterministic tests in lieu of real polling.

string

boolean

void


fireKeyDown(code): void

Defined in: InputManager.ts:1297

Public wrapper for synthetic key-down injection. Applies sync.

string

void


fireKeyUp(code): void

Defined in: InputManager.ts:1302

Public wrapper for synthetic key-up injection. Applies sync.

string

void


firePointerDown(button?, opts?): void

Defined in: InputManager.ts:1324

Public wrapper for synthetic pointer-button presses. Defaults to button 0 on the primary mouse pointer. Pass opts for touch / pen / non-primary pointers (e.g. { id: 5, type: "touch", isPrimary: false }).

0 | 1 | 2

number

boolean

PointerType

void


firePointerMove(screenX, screenY, opts?): void

Defined in: InputManager.ts:1311

Public wrapper for synthetic pointer movement. Defaults to the primary mouse pointer (id: 1, type: "mouse"); pass opts to drive a specific touch / pen pointer.

number

number

number

boolean

PointerType

void


firePointerUp(button?, opts?): void

Defined in: InputManager.ts:1341

Public wrapper for synthetic pointer-button releases.

0 | 1 | 2

number

void


fireWheel(dx, dy): void

Defined in: InputManager.ts:1361

Public wrapper for synthetic wheel input. Applies sync, including action edges and onWheel listener notification — matching the DOM path so tests and inspector probes drive the full surface.

number

number

void


gamepads(): readonly GamepadInfo[]

Defined in: InputManager.ts:1481

Synchronously poll navigator.getGamepads() for currently-connected pads. Use this rather than the cached event-driven list when you need ground truth — gamepadconnected doesn’t fire until the user presses a button.

readonly GamepadInfo[]


getActionNames(): string[]

Defined in: InputManager.ts:2617

Get all configured action names.

string[]


getActionsForKey(key): string[]

Defined in: InputManager.ts:1105

Returns all action names that have the given key bound.

string

string[]


getActivePad(): GamepadInfo | null

Defined in: InputManager.ts:1525

The pad whose analog input is read by default. Auto-promotes on input activity (button press or stick/trigger above deadzone) and on first connect. Returns null when no pad is connected.

GamepadInfo | null


getAxis(negative, positive): number

Defined in: InputManager.ts:796

Returns -1, 0, or 1 based on negative/positive action states.

string

string

number


getBindings(action): readonly string[]

Defined in: InputManager.ts:1100

Returns the current key bindings for an action, or an empty array if unmapped.

string

readonly string[]


getClockTime(): number

Defined in: InputManager.ts:510

Seconds elapsed on the raw input clock.

This clock advances from the engine’s unscaled frame time. Scene pause and time scaling do not affect it.

number


getGroupActions(name): readonly string[]

Defined in: InputManager.ts:1262

Get the action names belonging to a group. Returns empty array for unknown groups.

string

readonly string[]


getGroups(): string[]

Defined in: InputManager.ts:1257

Get all configured group names.

string[]


getHoldDuration(action, options?): number

Defined in: InputManager.ts:493

Seconds the action has been held. Returns 0 if not held.

The duration counts on the raw input clock (getClockTime), which ignores scene pause and time scale — a charge keeps charging through a pause menu. Pass options.clock — the SceneTime of a scene on the stack — to count it on that scene’s simulation time instead, so the hold stops with the scene and follows its time scale; any other clock throws.

string

HoldDurationOptions

number


getPointer(id): PointerInfo | undefined

Defined in: InputManager.ts:855

Direct lookup by pointerId, or undefined if no pointer with that id is tracked.

number

PointerInfo | undefined


getPointerPosition(): Vec2

Defined in: InputManager.ts:823

Primary pointer’s position in world coordinates (via Camera), or screen coords if no camera. Returns Vec2.ZERO when no pointer is tracked.

For multi-pointer access (touch UIs etc.) iterate getPointers and convert each screenPos via the camera as needed.

Vec2


getPointers(): readonly PointerInfo[]

Defined in: InputManager.ts:846

All currently-tracked pointers (one per active mouse, pen, or finger).

readonly PointerInfo[]


getPointerScreenPosition(): Vec2

Defined in: InputManager.ts:834

Primary pointer’s raw position in screen coordinates, or Vec2.ZERO when no pointer is tracked.

Vec2


getReleaseDuration(action, options?): number

Defined in: InputManager.ts:582

Seconds the action was held, valid only in the query window where the action is fully released — the last pressed binding (key or synthetic) lets go; a chord’s partial release reports 0. The window is the current frame or the current fixed step, matching the calling context like isJustPressed. Captured at the release edge, so it survives getHoldDuration resetting to 0 in that same window — no sample-before-release dance needed.

The length counts on the raw input clock unless options.clock names a registered scene clock, like getHoldDuration. Each clock captures its own length at the release, so a hold spanning a pause reports the scene’s simulation seconds on the scene clock, and the whole span including the pause on the raw one. A hold that began before a clock was registered reports only the part measured since, matching how it counted while held.

string

HoldDurationOptions

number


getStick(side, opts?): Vec2

Defined in: InputManager.ts:1440

Returns the deadzoned, magnitude-clamped stick vector for the given side.

By default reads from the active pad (the most recently used controller, or the first connected one if nothing has been used yet). Pass { pad: index } to read from a specific pad — useful for couch-co-op where each player’s controller is addressed explicitly.

Falls back to synthetic injection (fireGamepadAxis) when no pad is active — the test/probe/virtual-controls path — AND when the pad’s own stick rests inside the deadzone: a controller merely sitting plugged in (its resting noise stays inside the deadzone) must not mask a virtual stick that is actively deflected. A pad deflected past the deadzone always wins.

"left" | "right"

number

Vec2


getTrigger(side, opts?): number

Defined in: InputManager.ts:1462

Returns the deadzoned trigger value (0..1) for the given side. Reads from the active pad by default; use { pad: index } for explicit per-pad reads. Falls back to synthetic state when no pad is active or the pad’s trigger rests inside the deadzone (mirrors getStick).

"left" | "right"

number

number


getVector(left, right, up, down): Vec2

Defined in: InputManager.ts:803

Returns a Vec2 from four directional actions. Not normalized.

string

string

string

string

Vec2


hasAction(name): boolean

Defined in: InputManager.ts:1848

Whether name is defined in the current action map. Synthetic injection (fireAction / fireActionDown / setActionHeld) throws on unknown actions; callers that bind action names from config (virtual controls, rebind UIs) can validate up front instead of catching mid-gesture.

string

boolean


isGroupEnabled(name): boolean

Defined in: InputManager.ts:1252

Whether a group is currently enabled. Returns true for unknown group names.

string

boolean


isHeldFor(action, minSeconds, options?): boolean

Defined in: InputManager.ts:519

Whether the action has been held for at least minSeconds. Counts on the raw input clock unless options.clock names a registered scene clock, like getHoldDuration.

string

number

HoldDurationOptions

boolean


isJustHeldFor(action, seconds, options?): boolean

Defined in: InputManager.ts:544

Hold-start edge: true only in the query window where the action’s hold crosses seconds — the current frame or the current fixed step, matching the calling context like isJustPressed. Threshold- crossing math over the hold clock, so any call-site threshold works with no per-action config. Drives “released before T = a tap, crossed T = hold-start” input feel. A tap (released before the threshold) never fires it — the hold resets to 0 in the release window.

The hold counts on the raw input clock unless options.clock names a registered scene clock, like getHoldDuration. Each clock carries its own crossing baseline, so a threshold reached on scene time fires exactly once there whatever the raw clock has done meanwhile.

string

number

HoldDurationOptions

boolean


isJustPressed(action): boolean

Defined in: InputManager.ts:290

Whether a press edge for the action landed in the caller’s query window.

The window matches the calling context. From frame-phase code (update, listeners, any non-fixed system) it is the current rendered frame. From fixed-step code (fixedUpdate, Phase.FixedUpdate systems) it is the current fixed step: the edges that arrived since the previous step began. Each context sees a press exactly once — when several fixed steps run in one frame only the first sees it, and a press in a frame that runs no fixed step is held for the next step.

string

boolean


isJustReleased(action): boolean

Defined in: InputManager.ts:310

Whether a release edge for the action landed in the caller’s query window — the current frame or the current fixed step, matching the calling context like isJustPressed.

string

boolean


isJustReleasedAfter(action, minSeconds, options?): boolean

Defined in: InputManager.ts:646

True in the query window where the action is fully released — frame or fixed step, matching the calling context like isJustPressed — if it was held for at least minSeconds. Counts on the raw input clock unless options.clock names a registered scene clock, like getHoldDuration.

False when the clock holds no length for the release, as in isJustTapped.

string

number

HoldDurationOptions

boolean


isJustTapped(action, maxSeconds, options?): boolean

Defined in: InputManager.ts:623

True in the query window where the action is fully released — frame or fixed step, matching the calling context like isJustPressed — if it was held for at most maxSeconds. Counts on the raw input clock unless options.clock names a registered scene clock, like getHoldDuration.

False when the clock holds no length for the release — one that predates the clock’s registration, or landed while the action’s group was disabled. An unmeasured hold is not a tap.

string

number

HoldDurationOptions

boolean


isPointerConsumed(id): boolean

Defined in: InputManager.ts:946

Whether the pointer is currently marked consumed.

number

boolean


isPointerDown(): boolean

Defined in: InputManager.ts:840

Whether the primary pointer has any button held.

boolean


isPollingEnabled(): boolean

Defined in: InputManager.ts:1576

Whether real gamepad polling is currently enabled.

boolean


isPressed(action): boolean

Defined in: InputManager.ts:271

Whether any key mapped to this action is currently held.

string

boolean


listenForNextKey(): Promise<string | null>

Defined in: InputManager.ts:1280

Returns a promise that resolves with the next key code pressed. Intercepts the key.

Promise<string | null>


loadBindings(map): void

Defined in: InputManager.ts:1205

Load bindings from a plain object. Resets to defaults first, then overlays the provided map.

ActionMapDefinition

void


onAction(name, fn): () => void

Defined in: InputManager.ts:1016

Subscribe to action press edges (rising edge of any key bound to the action). Fires once per press. Returns a disposer.

string

(name) => void

() => void


onActionReleased(name, fn): () => void

Defined in: InputManager.ts:1032

Subscribe to action release edges. Returns a disposer.

string

(name) => void

() => void


onActivePadChanged(fn): () => void

Defined in: InputManager.ts:1545

Subscribe to active-pad changes. Replays the current active pad synchronously on subscribe so callers get the present state without a separate getActivePad() call. Returns a disposer.

(info) => void

() => void


onGamepadConnected(fn): () => void

Defined in: InputManager.ts:1500

Subscribe to gamepad-connected events. Replays currently-known pads synchronously so callers don’t need a separate gamepads() call. Returns a disposer.

(info) => void

() => void


onGamepadDisconnected(fn): () => void

Defined in: InputManager.ts:1510

Subscribe to gamepad-disconnected events. Returns a disposer.

(info) => void

() => void


onKeyDown(code, fn): () => void

Defined in: InputManager.ts:967

Subscribe to key-down events. Pass a code (e.g. "Space", "GamepadA") to filter, or "*" for all keys. The listener fires on the same edge isJustPressed reports — for DOM-originated events that’s the next Phase.EarlyUpdate after the browser dispatches; for synthetic injection (fireKeyDown) it’s synchronous. Returns a disposer.

string

(code) => void

() => void


onKeyUp(code, fn): () => void

Defined in: InputManager.ts:990

Subscribe to key-up events. See onKeyDown.

string

(code) => void

() => void


onPointerDown(fn): () => void

Defined in: InputManager.ts:884

Subscribe to pointer-down events (button transitions from up → down on a tracked pointer). Returns a disposer that detaches the listener.

(info) => void

() => void


onPointerMove(fn): () => void

Defined in: InputManager.ts:905

Subscribe to pointer-move events. Returns a disposer.

(info) => void

() => void


onPointerUp(fn): () => void

Defined in: InputManager.ts:896

Subscribe to pointer-up events (button transitions from down → up, plus touch / pen lifecycle ends and pointercancel). Returns a disposer.

(info) => void

() => void


onWheel(fn): () => void

Defined in: InputManager.ts:1052

Subscribe to scroll-wheel events. Receives raw deltaX/deltaY (already sign-flipped by InputConfig.wheelInvertY if set). Fires regardless of consumeWheel — it only gates action edges. Returns a disposer.

(dx, dy) => void

() => void


rebind(action, key, opts?): RebindResult

Defined in: InputManager.ts:1119

Rebind a key to an action with optional conflict detection. Conflicts are only detected between actions sharing at least one group.

string

string

RebindOptions

RebindResult


resetBindings(action?): void

Defined in: InputManager.ts:1181

Reset bindings to defaults. If an action name is provided, only reset that action.

string

void


setActionHeld(name, held): void

Defined in: InputManager.ts:1943

Mirror a held boolean onto an action: true routes to fireActionDown, false to fireActionUp. Lets a caller feed a pointer’s held state directly each frame. Throws on an unknown action name.

string

boolean

void


setActionMap(actions): void

Defined in: InputManager.ts:1068

Replace the entire action map and store it as the default for resetBindings.

ActionMapDefinition

void


setActiveGroups(names): void

Defined in: InputManager.ts:1242

Set exactly these groups as active; all others are disabled.

string[]

void


setActivePad(index): void

Defined in: InputManager.ts:1535

Manually set the active pad. Index must match a currently connected pad — pass an unknown index and the call is a no-op. Pass null to clear (analog reads will fall back to synthetic state if any).

number | null

void


setCamera(camera): void

Defined in: InputManager.ts:2607

Set camera for pointer world-coord conversion.

CameraLike

void


setDeadzones(opts): void

Defined in: InputManager.ts:1585

Update analog deadzones at runtime. Either field may be omitted. Values are clamped to [0, 0.999] — capping below 1 keeps the rescaling denominator non-zero. Non-finite values are ignored.

number

number

void


setGroups(groups): void

Defined in: InputManager.ts:1215

Configure input groups. Group name -> array of action names.

Record<string, string[]>

void


setPollingEnabled(enabled): void

Defined in: InputManager.ts:1571

Enable or disable real gamepad polling. Synthetic injection still works when disabled.

boolean

void


setTriggerThreshold(value): void

Defined in: InputManager.ts:1598

Set the trigger button-edge threshold (default 0.5). Clamped to [0, 1]; non-finite values are ignored.

number

void


snapshotState(): object

Defined in: InputManager.ts:2016

Snapshot of current held input state for inspector tooling.

object

actions: string[]

gamepad: object

axes: object[]

buttons: string[]

keys: string[]

mouse: object

buttons: number[]

down: boolean

x: number

y: number

pointers: object[]


unbindKey(action, key): void

Defined in: InputManager.ts:1090

Remove a key binding from an action.

string

string

void