ecspresso
    Preparing search index...

    Interface InputPluginOptions<A, G>

    Common configuration options shared by most plugins. Plugin-specific options interfaces extend this with additional fields.

    interface InputPluginOptions<
        A extends string = string,
        G extends string = "input",
    > {
        actions?: ActionMap<A>;
        coordinateTransform?: (
            clientX: number,
            clientY: number,
        ) => { x: number; y: number };
        gamepad?: GamepadOptions;
        phase?: SystemPhase;
        players?: Record<string, ActionMap<A>>;
        preventDefaultKeys?: KeyCode[];
        preventDefaultPointerButtons?: number[];
        priority?: number;
        shouldPreventDefault?: (event: PointerEvent | KeyboardEvent) => boolean;
        systemGroup?: G;
        target?: EventTarget;
    }

    Type Parameters

    • A extends string = string
    • G extends string = "input"

    Hierarchy (View Summary)

    Index

    Properties

    actions?: ActionMap<A>

    Initial unified action map.

    coordinateTransform?: (
        clientX: number,
        clientY: number,
    ) => { x: number; y: number }

    Optional conversion from raw DOM client coordinates to the space inputState.pointer.position should report. Renderer-agnostic: wire to clientToLogical(...) from renderer2D when using screenScale, or to a renderer-specific helper. When omitted, pointer coords remain raw clientX/clientY (not canvas-relative).

    gamepad?: GamepadOptions

    Gamepad polling and deadzone configuration.

    phase?: SystemPhase

    Execution phase for the plugin's primary system

    players?: Record<string, ActionMap<A>>

    Initial per-player action maps, keyed by player id.

    preventDefaultKeys?: KeyCode[]

    Keys whose browser default behaviour should be suppressed (e.g. ['Tab', ' ', 'ArrowDown']). Ignored when shouldPreventDefault is provided.

    preventDefaultPointerButtons?: number[]

    Pointer button indices whose browser default behaviour should be suppressed (e.g. [0, 2]). Ignored when shouldPreventDefault is provided.

    priority?: number

    Priority for the plugin's primary system (default varies per plugin)

    shouldPreventDefault?: (event: PointerEvent | KeyboardEvent) => boolean

    Custom predicate for full control over preventDefault. Receives the raw DOM event and returns true to suppress its default behaviour. When provided, preventDefaultKeys and preventDefaultPointerButtons are ignored.

    systemGroup?: G

    System group name for all systems registered by this plugin

    target?: EventTarget

    EventTarget to attach listeners to (default: globalThis). Pass a custom target for testability.