CLASSES
TagsA - Z

Gamepad

Gamepad

Description

class Gamepad

Constructor

new Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY)

Parameters

Name Type Description
id string The gamepad id
index number The gamepad index
browserGamepad any The object that holds the gamepad informations
optional leftStickX number
optional leftStickY number
optional rightStickX number

Members

id : string

The gamepad id

index : number

The gamepad index

browserGamepad : any

The gamepad browser, sets the sticks axes

type : number

static GAMEPAD : number

static GENERIC : number

static XBOX : number

static POSE_ENABLED : number

leftStick : StickValues

The left stick values

rightStick : StickValues

The right stick values

Methods

onleftstickchanged(callback) → void

Binds an action to the left stick

Parameters

Name Type Description
callback (values: StickValues) => void The action to bind

onrightstickchanged(callback) → void

Binds an action to the right stick

Parameters

Name Type Description
callback (values: StickValues) => void The action to bind

update() → void