Engine API Reference - v2.10.3
    Preparing search index...

    Class GamepadSourceAlpha

    Game pad input source class

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _element: null | HTMLElement = null
    deltas: { buttons: InputDelta; leftStick: InputDelta; rightStick: InputDelta } = ...

    Type declaration

    • buttons: InputDelta

      The button deltas, represented as an array of button states (0 or 1).

    • leftStick: InputDelta

      The left stick deltas, represented as an array of [x, y] coordinates.

    • rightStick: InputDelta

      The right stick deltas, represented as an array of [x, y] coordinates.

    buttonCode: {
        A: 0;
        B: 1;
        LB: 4;
        LEFT_STICK: 10;
        LT: 6;
        RB: 5;
        RIGHT_STICK: 11;
        RT: 7;
        SELECT: 8;
        START: 9;
        X: 2;
        Y: 3;
    } = BUTTON_CODES

    The button codes (based on Xbox controller layout).

    Methods

    • Alpha

      Fires an event with the given name and arguments.

      Parameters

      • event: string

        The event name to fire.

      • ...args: any[]

        The arguments to pass to the event listeners.

      Returns void

    • Alpha

      Returns { buttons: number[]; leftStick: number[]; rightStick: number[] }

      • buttons: number[]

        The button deltas, represented as an array of button states (0 or 1).

      • leftStick: number[]

        The left stick deltas, represented as an array of [x, y] coordinates.

      • rightStick: number[]

        The right stick deltas, represented as an array of [x, y] coordinates.