q5play
    Preparing search index...

    Class Contro

    Hierarchy (View Summary)

    Index
    • Stores the input status of buttons, triggers, and sticks on game controllers. Used internally to create controller objects for the contros array (aka controllers).

      Can also be used to create a mock controller object.

      Parameters

      • gp: string | Gamepad

      Returns Contro

    a: number
    axeMapping: any

    Sticks and triggers are mapped to gamepad.axes indices.

    b: number
    buttonMapping: any

    Button names are mapped to gamepad.buttons indices.

    connected: boolean
    down: number
    gamepad: Gamepad
    hasAnalogTriggers: boolean

    True if the controller has analog triggers. False if the controller has digital (button) triggers.

    holdThreshold: number

    The amount of frames an input must be pressed to be considered held.

    12
    
    id: any
    isMock: boolean

    If the controller is a mock controller.

    l: number

    Left shoulder button.

    left: number
    leftStick: any

    Has x and y properties with -1 to 1 values which represent the position of the left analog stick.

    {x: 0, y: 0} is the center position.

    leftTrigger: number

    Analog value 0-1 of the left trigger.

    0
    
    lsb: number

    Left stick button. Activated by pressing down on the left analog stick.

    lt: number

    Digital left trigger.

    r: number

    Right shoulder button.

    right: number
    rightStick: any

    Has x and y properties with -1 to 1 values which represent the position of the right analog stick.

    {x: 0, y: 0} is the center position.

    rightTrigger: number

    Analog value 0-1 of the right trigger.

    0
    
    rsb: number

    Right stick button. Activated by pressing down on the right analog stick.

    rt: number

    Digital right trigger.

    select: number
    start: number
    up: number
    x: number
    y: number
    • get l2(): number

      Alias for leftTrigger (analog left trigger). l2 is what it's called on PlayStation controllers.

      Returns number

    • get r2(): number

      Alias for rightTrigger (analog right trigger). r2 is what it's called on PlayStation controllers.

      Returns number

    • Same as the released function, which is preferred.

      Parameters

      • Optionalinp: string

      Returns boolean

      true on the first frame that the user released the input