JavaScripture
Contribute via GitHub Feedback

GamepadButton : Object

Represents a button on the Gamepad.

Instance Properties

pressed : Boolean  

true if the button was pressed. For buttons that support value, pressed will be true when value passes a platform/browser specified threshold.

Example:

Run

Results:

 

touched : Boolean  

true if the user is touching the button but not necessarily pressing the button. For hardware that cannot detech touches, will be true when the user is pressing the button.

Example:

Run

Results:

 

value : Number  

The pressure that the button was pressed with between 0 (light press) and 1 (hard press). If the button doesn't measure pressure, will be 0 when unpressed and 1 when pressed.

Example:

Run

Results: