Gamepad / 03

Gamepad info.

Scans for connected controllers via the Gamepad API. Reports identifier string, button count, axis count, mapping standard, and vibration support.

Notes

Press a button on the controller before pressing Start — Chrome only exposes gamepads after the first input event.

No controller detected

Connect a gamepad and press any button — browsers only expose pads after the first input. This view then updates live.

How it works

We call navigator.getGamepads() on entry. If nothing is enumerated, we add a one-shot gamepadconnected listener and wait up to 6 seconds for a button press to register a controller.

Per pad we report identifier string (vendor + product), button count, axis count, mapping standard, and whether the vibration actuator is exposed. The identifier is what controller-mapping libraries use to pick the right button layout.

Frequently asked

Why does my gamepad not show up?

Chrome / Firefox only expose gamepads after the first input event — press any button on the controller, then re-run. Some browsers also skip pads paired via Bluetooth that haven't been claimed by the OS yet. As a last resort, try a wired connection.

What is the 'mapping' field?

Empty string = the browser doesn't have a canonical layout for this controller; button indices may be unpredictable. 'standard' = Xbox-style mapping (button 0=A, 1=B, 2=X, 3=Y, etc). Most modern controllers report 'standard' on Chromium browsers; older or off-brand pads may not.

Why is vibration supported on some pads but not others?

Vibration / haptics need both browser support (Chrome 90+, Edge 90+) and a controller with rumble motors that expose them via the gamepad protocol. Xbox controllers via USB on Chrome support it. DualSense and Joy-Con are inconsistent depending on connection type and OS.

Can I use the gamepad to navigate web pages?

Not natively. The Gamepad API only delivers raw button + axis state to JS; remapping pad input to keyboard / mouse events is up to each individual site. Browser extensions exist that do this generically.