GenericPad

Represents a generic gamepad

Hierarchy

Index

Constructors

constructor

Find examples in Playground
  • 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

browserGamepad

Find examples in Playground
browserGamepad: any

The browser gamepad

id

Find examples in Playground
id: string

The id of the gamepad

index

Find examples in Playground
index: number

The index of the gamepad

isConnected

Find examples in Playground
isConnected: boolean

Specifies if the gamepad has been connected

leftStick

Find examples in Playground
leftStick: StickValues

Sets the left joystick values

onButtonDownObservable

Find examples in Playground
onButtonDownObservable: Observable<number>

Observable triggered when a button has been pressed

onButtonUpObservable

Find examples in Playground
onButtonUpObservable: Observable<number>

Observable triggered when a button has been released

rightStick

Find examples in Playground
rightStick: StickValues

Sets the right joystick value

type

Find examples in Playground
type: number

Specifies what type of gamepad this represents

Static GAMEPAD

Find examples in Playground
GAMEPAD: number

Represents a gamepad controller

Static GENERIC

Find examples in Playground
GENERIC: number

Represents a generic controller

Static POSE_ENABLED

Find examples in Playground
POSE_ENABLED: number

Represents a pose-enabled controller

Static XBOX

Find examples in Playground
XBOX: number

Represents an XBox controller

Methods

dispose

Find examples in Playground
  • dispose(): void

onbuttondown

Find examples in Playground
  • onbuttondown(callback: function): void
  • Callback triggered when a button has been pressed

    Parameters

    • callback: function

      Called when a button has been pressed

        • (buttonPressed: number): void
        • Parameters

          • buttonPressed: number

          Returns void

    Returns void

onbuttonup

Find examples in Playground
  • onbuttonup(callback: function): void
  • Callback triggered when a button has been released

    Parameters

    • callback: function

      Called when a button has been released

        • (buttonReleased: number): void
        • Parameters

          • buttonReleased: number

          Returns void

    Returns void

onleftstickchanged

Find examples in Playground
  • onleftstickchanged(callback: function): void

onrightstickchanged

Find examples in Playground
  • onrightstickchanged(callback: function): void

update

Find examples in Playground
  • update(): void
  • Updates the generic gamepad

    Returns void

Generated using TypeDoc