Hardware & Capabilities · Browser Tests
Gamepad Test
Detect connected controllers and read their buttons and axes live, using the Gamepad API.
Browsers hide gamepads until you interact with one, so the list stays empty until you press a button or move a stick. Connect the controller first if you have not already.
Controllers
Live buttons — first controller
Live axes
Input is read frame by frame on your device and shown only here. Nothing is sent anywhere, no rumble is triggered and no value is stored.
On this page
What the Gamepad API can see
The Gamepad API lets a web page read controllers connected to your machine. A call to navigator.getGamepads() returns a list, one entry per pad the browser knows about, and each entry is a snapshot of its current state.
- id is a string naming the device, usually the vendor and product, for example a Xbox or DualSense identifier.
- mapping is either standard or empty, and it says whether the button order follows the W3C layout.
- buttons is an array, each item carrying a pressed flag, a touched flag and an analogue value from 0 to 1.
- axes is an array of floats from -1 to 1 for sticks and sometimes triggers.
- timestamp marks when the snapshot was taken, and connected says whether the pad is still present.
The panel above reads all of it and shows the counts, the layout and a live view of the input.
Standard and raw layouts
The mapping field is the difference between code that works anywhere and code that needs a lookup table. When it reads standard, the browser has already normalised the pad to the W3C layout: button 0 is the bottom face button, 1 is right, 2 is left, 3 is top, and the shoulder, trigger and menu buttons follow a fixed order.
When the field is empty, the device is reporting its own arrangement. The counts still work, so the panel can tell you how many buttons and axes exist, but the meaning of each index depends on the controller. That is why a game written for standard pads may behave oddly with an unusual or older device. The panel labels the mapping for each entry so you can see which situation you are in.
How the live read-out works
The Gamepad API has no input events. There is no buttonpressed callback; a page has to ask for the current state on a loop, and the natural loop is requestAnimationFrame, which runs once per repaint, so a 60 Hz display is polled about sixty times a second.
The panel does exactly that. Each frame it takes a fresh snapshot, and rebuilds the pressed-button chips only when the set of pressed buttons changes, so the page is not rewriting the DOM sixty times a second for nothing. The axis rows are updated in place, because a stick moves continuously and its value changes on almost every frame. Polling stops costing anything noticeable when no controller is present, since the loop simply checks an empty list and waits for the next frame.
Why one pad behaves differently in each browser
Three things decide what this API reports, and they rarely line up. The first is the operating system’s driver: Windows reads an Xbox pad through XInput, while a PlayStation pad over Bluetooth may present as a generic HID device until a driver is installed. The second is the browser’s own input backend, so the same physical controller can report a standard mapping in Chrome and a raw layout in Firefox.
The third is context. The API is only exposed in a secure context, so it works over HTTPS and not on an insecure page, and mobile support is patchy, particularly on iOS. Rumble is separate again: where a pad exposes a GamepadHapticActuator, a site can call playEffect to vibrate it, but this page never does. The device and hardware test covers the rest of what a page can learn about attached hardware.
What it does and does not reveal
The controller id is the only genuinely identifying value here, and it is narrow: it is readable only while a pad is connected and has been used, and it is shared by everyone with the same model. On a desktop with no controller attached, the API returns an empty list and reveals nothing at all. That is a much smaller footprint than the sensors in the device and hardware test or the touch signals in the touch support test.
This page reads input and shows it, and goes no further. It never triggers rumble or vibration, even on pads that support it, because that would be a side effect you did not ask for. Nothing is recorded, nothing is uploaded, and the read-out is gone the moment you close the tab. For the wider picture of what a page can detect about your machine, try the browser information test.