This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
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.
The following interfaces are defined in the Gamepad API
The Gamepad API also defines some events and a specialist function:
- Specialist events on the
Windowobject that allows us to react when a gamepad is connected or disconnected:
gamepaddisconnected. Event handlers can be easily set using
- An extension to the
Navigatorobject that returns an array of
Gamepadobjects, one for each connected gamepad.
Tutorials and guides
The definition of 'The Gamepad API specification' in that specification.
|Working Draft||Initial definition|
|Feature||Chrome||Edge||Firefox (Gecko)||Internet Explorer||Opera||Safari (WebKit)|
|General support||21.0 webkit
|(Yes)||29.0 (29.0)||No support||15.0 webkit
|Feature||Android||Edge||Firefox Mobile (Gecko)||IE Phone||Opera Mobile||Safari Mobile||Samsung Internet|
|General support||No support||(Yes)||32.0 (32.0)||No support||No support||No support||Yes|