JavaScript Gamepad Guide
Gamepad API connects game controllers for browser-based games and interactive applications. The guide walks through Detecting Controllers. `navigator.getGamepads()` — array of connected gamepads. `gamepadconnected` / `gamepaddisconnected` events. Poll in rAF: `const gp=navigator.getGamepads()[0]; gp.buttons[0].pressed; gp.axes[0]`. Buttons: pressed (bool), value (0-1 analog). Axes: -1 to 1. The guide is organized into 1 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page. Practice what you learn in the JavaScript playground, and look up any unfamiliar term in the JavaScript glossary.