GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — Gamepad API - Web APIs | MDN

Gamepad API

Baseline
Widely available
*

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.

* Some parts of this feature may have varying levels of support.

  • See full compatibility
  • Learn more

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.

Interfaces

Gamepad

Represents a gamepad/controller connected to the computer.

GamepadButton

Represents a button on one of the connected controllers.

GamepadEvent

The event object representing events fired that are related to gamepads.

Experimental Gamepad extensions

GamepadHapticActuator

Represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.

GamepadPose

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.

Extensions to other interfaces

Navigator

Navigator.getGamepads()

An extension to the Navigator object that returns an array of Gamepad objects, one for each connected gamepad.

Window events

gamepadconnected

An event that will fire when a gamepad is connected.

gamepaddisconnected

An event that will fire when a gamepad is disconnected.

Tutorials and guides

  • Using the Gamepad API
  • Implementing controls using the Gamepad API

Specifications

Specification
Gamepad
# gamepad-interface
Gamepad Extensions
# partial-gamepad-interface

Browser compatibility

See also

  • The Gamepad API by Ted Mielczarek and Robert Nyman
  • Simple API demo page (source)

Help improve MDN

Learn how to contribute

This page was last modified on Dec 27, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.