Gamepad provides basic support for gamepads.
Some gamepads require a button press to being detected.
Gamepad implementation across browsers is still fragmented, every browser implements it a bit differently, so test it on every target before deploying an application using it.
For more information about the Gamepad API state take look at the W3C Gamepad API page https://www.w3.org/TR/gamepad/.
Disconnect this gamepad object.
Get analog button value between 0 and 1.
If the button is not analog enabled it will return 0 if button is not pressed or 1 if the button is pressed.
Button to get analogue value from.
Value between 0 and 1 depending how hard the button is pressed.
Get axis value between -1 and 1 depending on the direction.
to get value from.
Value between -1 and 1 depending on the axis direction
Set which gamepad should be used by this Gamepad instance.
Can be used to override the gamepad attached to this object and enable multiple gamepad support.
Get vendor id and product id for the connected gamepad.
Update the gamepad state.
Should be called every frame before checking the buttons values.