Documentation
    Preparing search index...

    Interface MockGamepadOptions

    Factory options for the gamepad mock.

    const pads = createMockGamepadService({ autoplay: true, tickMs: 16 });
    
    interface MockGamepadOptions {
        autoplay?: boolean;
        clock?: MockClock;
        latencyMs?: number;
        pads?: readonly (MockGamepadPad | null)[];
        scheduler?: MockScheduler;
        seed?: number;
        tickMs?: number;
        unavailable?: "unavailable" | "blocked";
    }

    Hierarchy (View Summary)

    Index

    Properties

    autoplay?: boolean

    Emit an idle stick-drift sample loop through the scheduler.

    clock?: MockClock

    Clock used for timestamps. Default: Date.now.

    latencyMs?: number

    Artificial latency (ms) applied before each result. Default 0, which responds synchronously inside handleMessage.

    pads?: readonly (MockGamepadPad | null)[]

    Initial slots. Default: two standard-mapping pads at slots 0 and 1.

    scheduler?: MockScheduler

    Scheduler used for deferred pushes. Default: setTimeout.

    seed?: number

    Seed for deterministic ids and fixture ordering. Default 1.

    tickMs?: number

    Loop interval for autoplay. Default 16.

    unavailable?: "unavailable" | "blocked"

    Report available: false with this reason.