The Gamepad API is a way for developers to access and respond to signals from gamepads and other game controllers in a simple, consistent way. It contains three interfaces, two events and one specialist function, to respond to gamepads being connected and disconnected, and to access other information about the gamepads themselves, and what buttons and other controls are currently being pressed.
- Represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.
- Represents the pose of a controller (e.g. position and orientation in 3D space) in the case of a WebVR controller. This is not used by the newer WebXR standard.
See also the extensions to the Gamepad interface, for features that allow you to access the above information.
- An extension to the
Navigatorobject that returns an array of
Gamepadobjects, one for each connected gamepad.
|Gamepad Extensions||Editor's Draft||Defines the Experimental Gamepad extensions.|
The definition of 'The Gamepad API specification' in that specification.
|Working Draft||Initial definition|
BCD tables only load in the browser