CLASSES
TagsA - Z

GenericPad

Gamepad

Description

class GenericPad extends Gamepad

Constructor

new GenericPad(id, index, gamepad)

Builds a Gamepad object

Parameters

Name Type Description
id string The gamepad id
index number The gamepad index
gamepad any The object that holds the gamepad informations

Members

id : string

The gamepad id

index : number

The gamepad index

gamepad : any

The gamepad object access this way : gamepad.buttons[]

Methods

onbuttondown(callback) → void

Binds an action to the button pressed, recognized by the button's index in the array

Parameters

Name Type Description
callback (buttonPressed: number) => void The function to execute

onbuttonup(callback) → void

Binds an action to the button released, recognized by the button's index in the array

Parameters

Name Type Description
callback (buttonReleased: number) => void The function to execute

update() → void