Class Gamepad
Hierarchy
Index
Constructors
constructor
Initializes the gamepad
Parameters
id: string
The id of the gamepad
index: number
The index of the gamepad
browserGamepad: any
The browser gamepad
Optional leftStickX: number
The x component of the left joystick
Optional leftStickY: number
The y component of the left joystick
Optional rightStickX: number
The x component of the right joystick
Optional rightStickY: number
The y component of the right joystick
Returns Gamepad
Properties
browser GamepadSearch playground for browserGamepad
The browser gamepad
idSearch playground for id
The id of the gamepad
indexSearch playground for index
The index of the gamepad
typeSearch playground for type
Specifies what type of gamepad this represents
Static DUALSHOCKSearch playground for DUALSHOCK
Represents an Dual Shock controller
Static GAMEPADSearch playground for GAMEPAD
Represents a gamepad controller
Static GENERICSearch playground for GENERIC
Represents a generic controller
Static POSE_ ENABLEDSearch playground for POSE_ENABLED
Represents a pose-enabled controller
Static XBOXSearch playground for XBOX
Represents an XBox controller
Accessors
is Connected
Specifies if the gamepad has been connected
Returns boolean
left Stick
Gets the left joystick
Returns StickValues
Sets the left joystick values
Parameters
newValues: StickValues
Returns void
right Stick
Gets the right joystick
Returns StickValues
Sets the right joystick value
Parameters
newValues: StickValues
Returns void
Methods
disposeSearch playground for dispose
Disposes the gamepad
Returns void
onleftstickchangedSearch playground for onleftstickchanged
Callback triggered when the left joystick has changed
Parameters
callback: ((values: StickValues) => void)
Parameters
values: StickValues
Returns void
Returns void
onrightstickchangedSearch playground for onrightstickchanged
Callback triggered when the right joystick has changed
Parameters
callback: ((values: StickValues) => void)
Parameters
values: StickValues
Returns void
Returns void
updateSearch playground for update
Updates the gamepad joystick positions
Returns void
Represents a gamepad