Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a generic gamepad

Hierarchy

Index

Constructors

  • new GenericPad(id: string, index: number, browserGamepad: any): GenericPad
  • Initializes the generic gamepad

    Parameters

    • id: string

      The id of the generic gamepad

    • index: number

      The index of the generic gamepad

    • browserGamepad: any

      The browser gamepad

    Returns GenericPad

Properties

_isConnected: boolean
internal
browserGamepad: any

The browser gamepad

id: string

The id of the gamepad

index: number

The index of the gamepad

onButtonDownObservable: Observable<number>

Observable triggered when a button has been pressed

onButtonUpObservable: Observable<number>

Observable triggered when a button has been released

type: number

Specifies what type of gamepad this represents

DUALSHOCK: number

Represents an Dual Shock controller

GAMEPAD: number

Represents a gamepad controller

GENERIC: number

Represents a generic controller

POSE_ENABLED: number

Represents a pose-enabled controller

XBOX: number

Represents an XBox controller

Accessors

  • get isConnected(): boolean
  • Specifies if the gamepad has been connected

    Returns boolean

  • Gets the left joystick

    Returns StickValues

  • Sets the left joystick values

    Parameters

    Returns void

  • Gets the right joystick

    Returns StickValues

  • Sets the right joystick value

    Parameters

    Returns void

Methods

  • dispose(): void
  • Disposes the generic gamepad

    Returns void

  • onbuttondown(callback: ((buttonPressed: number) => void)): void
  • Callback triggered when a button has been pressed

    Parameters

    • callback: ((buttonPressed: number) => void)

      Called when a button has been pressed

        • (buttonPressed: number): void
        • Parameters

          • buttonPressed: number

          Returns void

    Returns void

  • onbuttonup(callback: ((buttonReleased: number) => void)): void
  • Callback triggered when a button has been released

    Parameters

    • callback: ((buttonReleased: number) => void)

      Called when a button has been released

        • (buttonReleased: number): void
        • Parameters

          • buttonReleased: number

          Returns void

    Returns void

  • onleftstickchanged(callback: ((values: StickValues) => void)): void
  • onrightstickchanged(callback: ((values: StickValues) => void)): void
  • update(): void
  • Updates the generic gamepad

    Returns void

Legend

  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static method

Settings

Theme