Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Gamepad
interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
A Gamepad object can be returned in one of two ways: via the gamepad
property of the gamepadconnected
and gamepaddisconnected
events, or by grabbing any position in the array returned by the Navigator.getGamepads()
method.