Class PS4Controller

The PS4Controller class models a single PS4 controller connected to the computer, providing ButtonInput & SliderInput properties for the various inputs on the controller.

Hierarchy

  • PS4Controller

Implements

Constructors

Accessors

  • get L3_rotation(): SliderInput
  • The angle of the L3 analog stick, measured clockwise in degrees from the stick pointing directly upwards. Values fall in the range (-180, 180]

    Returns SliderInput

  • get R3_rotation(): SliderInput
  • The angle of the R3 analog stick, measured clockwise in degrees from the stick pointing directly upwards. Values fall in the range (-180, 180]

    Returns SliderInput

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • Checks if the passed in Gamepad API object can be matched to this PS4 controller, requiring that it have 16 buttons & 4 axes.

    Returns

    Parameters

    • gamepadObject: Gamepad

      The Gamepad API object to potentially be matched to.

    Returns boolean

  • Automatically called by the system, shouldn't be called by consumers of the library. Updates each button and slider on the controller.

    Parameters

    • deltaMs: number

      How many milliseconds since the last update cycle

    Returns void

Generated using TypeDoc