Documentation
    Preparing search index...

    Type Alias MockGamepadService

    MockGamepadService: MockService<MockGamepadState> & {
        connect(pad: MockGamepadPad): void;
        disconnect(padIndex: number): void;
        press(
            windowId: string,
            padIndex: number,
            button: number,
            value?: number,
        ): void;
        release(windowId: string, padIndex: number, button: number): void;
        setAxes(windowId: string, padIndex: number, axes: readonly number[]): void;
        setFocus(windowId: string | null): void;
    }

    Gamepad mock plus input controls.

    Type Declaration

    • connect: function
    • disconnect: function
    • press: function
      • Focus windowId and press button on slot padIndex (value 0..1, default 1).

        Parameters

        • windowId: string
        • padIndex: number
        • button: number
        • Optionalvalue: number

        Returns void

    • release: function
      • Focus windowId and release button on slot padIndex.

        Parameters

        • windowId: string
        • padIndex: number
        • button: number

        Returns void

    • setAxes: function
      • Focus windowId and set the axes of slot padIndex.

        Parameters

        • windowId: string
        • padIndex: number
        • axes: readonly number[]

        Returns void

    • setFocus: function
      • Move input focus (or clear it with null) and push changed snapshots.

        Parameters

        • windowId: string | null

        Returns void