
Some gamepad controls report an analog value as well as a pressed flag. Treating a trigger as a binary button throws away information needed for gradual acceleration. The browser interface at the center of this behavior is GamepadButton.
The interface behind the interaction
The useful boundary for this test is the point where GamepadButton hands control back to the application. Write down what the user did just before that point and which result the page could observe. This makes a failure reproducible even when two devices show different prompts or expose different hardware.
A test you can repeat on two devices
Record value and pressed while squeezing slowly, then release just below your chosen threshold. Inspect the points where the game changes gear or opens a menu.
For this run, capture the input, the user-visible result and the condition in which it was observed. On the comparison device, use the same input before changing any settings. If the outcome differs, attach a short trace to the result so that the next engineer can tell where the behavior started to diverge.
Check the individual members
The compatibility record for a whole interface can predate a particular capability. The implementation decision for GamepadButton depends on which member the application actually uses. Read the three desktop entries in order: Chrome, Firefox, then Safari.
pressed— version 21, version 29, version 10.1.touched— version 73, version 55, no support recorded.value— version 21, version 29, version 10.1.
Which browsers record support for GamepadButton?
All six browser families in the table have an unprefixed entry without a flag or a partial-implementation marker for this interface. The earliest recorded versions differ across families. A broad row of positive entries still leaves individual members, device access and platform limits to examine.
| Browser family | First recorded standard entry |
|---|---|
| Chrome desktop | Version 21 |
| Firefox desktop | Version 29 |
| Safari on macOS | Version 10.1 |
| Chrome on Android | Version 25 |
| Firefox on Android | Version 32 |
| Safari on iOS | Version 10.3 |
Source snapshot: MDN Browser Compatibility Data 8.1.10, 19 November 2026. “Version” is the first recorded entry in this comparison. Individual methods can have later introduction dates.
Plan for the unavailable case
Use a small hysteresis band when turning continuous input into a toggle. Keep a remappable digital alternative for devices with different controls.
typeof globalThis.GamepadButton !== "undefined"This expression checks the interface or property in the current JavaScript environment. A positive answer does not run the device test above. Consult the member-level entries for pressed, touched, value when any of them is a requirement.
Sources and further reading
- GamepadButton reference and member details
- Interface specification
- MDN compatibility data, version 8.1.10
Cover photograph: Nintendo-Game-Boy-Advance-Milky-Blue-FL by Evan-Amos. Public domain. Cropped and typeset for this cover. The photograph illustrates the topic.
