Skip to content

InputConfig

Defined in: types.ts:20

Configuration for the InputPlugin.

optional actions?: ActionMapDefinition

Defined in: types.ts:24

Action map: action name -> array of physical key codes.


optional deadzones?: object

Defined in: types.ts:39

Deadzone thresholds for analog inputs.

optional stick?: number

Radial deadzone applied to stick magnitude (default 0.15).

optional trigger?: number

Lower deadzone for trigger analog values (default 0.05).


optional groups?: Record<string, string[]>

Defined in: types.ts:26

Input groups: group name -> array of action names belonging to it.


optional pollGamepads?: boolean

Defined in: types.ts:56

Whether to poll navigator.getGamepads() each frame (default true). Disable to use only synthetic input via fireGamepadButton/fireGamepadAxis — useful for inspector probes that want deterministic state.


optional preventDefaultKeys?: string[]

Defined in: types.ts:28

Key codes to call preventDefault() on (default: none).


optional preventDefaultWheel?: boolean

Defined in: types.ts:69

Call preventDefault() on incoming wheel events so the page does not scroll. Default false — opt in only if your game canvas should swallow scroll. The listener is attached as { passive: false } when this is enabled so preventDefault() actually takes effect.


optional rendererKey?: ServiceKey<RendererAdapter>

Defined in: types.ts:37

Optional override for the renderer service key. When omitted, InputPlugin auto-resolves RendererAdapterKey — the canonical @yagejs/renderer plugin registers itself under that key, so pointer events target its canvas and coordinates route through canvasToVirtual out of the box. Set this only if you ship a custom renderer registered under a different key.


optional target?: HTMLElement

Defined in: types.ts:22

Target element for pointer events (default: canvas from renderer, or document).


optional triggerThreshold?: number

Defined in: types.ts:50

Trigger value at which GamepadLT/GamepadRT fire as button edges in the action map (default 0.5). Below this, the trigger remains “released” for isPressed purposes; the analog getTrigger value is unaffected.


optional wheelInvertY?: boolean

Defined in: types.ts:62

Invert vertical scroll so positive dy means up (default false, matching the W3C convention where positive deltaY is “scroll content down”). Affects both onWheel callbacks and WheelUp/Down action edges.