How does the browser Gamepad API measure drift and circularity?
Every time your browser paints an animation frame, this diagnostic polls navigator.getGamepads() to read normalized X/Y thumbstick coordinates, trigger pressure floats, and digital button bits straight from memory. No controller serial number, input stream, or stick drift test result leaves your browser tab.
Waking the privacy gate and polling frames
Plugging in a USB cable or pairing over Bluetooth does not immediately populate the device list in a browser. Under the W3C Gamepad API Specification, browsers hide connected controllers behind an explicit interaction gate until you press a face button, tap the D-pad, or squeeze a trigger.
While waiting for that wake gesture, the tester checks navigator.getGamepads() every 500 ms and listens for gamepadconnected events. Once active, polling switches to requestAnimationFrame so Left stick and Right stick telemetry tracks your thumb movement at your display refresh rate.
- Slot selection: When two or more controllers are connected simultaneously, pick the active device from Connected controller in the sidebar.
- Manual probe: Clicking Check for controllers forces an immediate snapshot read after plugging in an adapter or switching Steam Input off.
If you are diagnosing broader desktop input peripherals in the same session, check your controller inputs here first. You can then check keyboard key rollover and anti-ghosting before launching a game.
Sampling 36 angular sectors and outer collar reach
Each stick panel divides a full 360-degree rotation into 36 angular buckets spanning 10 degrees apiece. Whenever radial magnitude reaches at least 0.5, the tracker records the highest reach inside the active sector, capped at 1.5 inside the 150 × 150 px SVG view.
Once 12 or more sectors hold valid outer samples, the plot displays Error as the average deviation from an ideal 1.000 unit circle (|r - 1| × 100). A dashed square surrounding the solid circle shows how far corners can physically extend toward 1.414 (sqrt(2)) when a sensor outputs unscaled square axes.
Testing Xbox, PlayStation, Switch, and generic button legends
Switching Button labels between Xbox (A / B / X / Y), PlayStation (Cross / Circle / Square / Triangle), Nintendo Switch (B / A / Y / X), and Generic HID indices (B0-B16) remaps the same underlying W3C indices without resetting your stick circularity ring. Under the MDN Gamepad API Documentation, browsers label recognized layouts with mapping: "standard" across 17 buttons (B0 through B16).
| Standard index | Xbox legend | PlayStation legend | Nintendo Switch | Generic HID | Electrical signal |
|---|---|---|---|---|---|
B0–B3 |
A, B, X, Y |
Cross, Circle, Square, Triangle |
B, A, Y, X |
B0–B3 |
Digital boolean plus value 0 or 1 |
B4–B5 |
LB, RB |
L1, R1 |
L, R |
L1, R1 |
Shoulder bumper switch (0.00 or 1.00) |
B6–B7 |
LT, RT |
L2, R2 |
ZL, ZR |
L2, R2 |
Analog 0.00–1.00 (digital on Switch) |
B8–B9 |
View, Menu |
Share, Options |
Minus, Plus |
Select, Start |
Center utility buttons |
B10–B11 |
L3, R3 |
L3, R3 |
LS, RS |
L3, R3 |
Thumbstick click-in switches |
B12–B16 |
D-pad, Xbox |
D-pad, PS |
D-pad, Home |
D-pad, Home |
4-way directional cluster and guide button |
Notice how Xbox and Nintendo Switch swap horizontal and vertical face pairs (A/B and X/Y) at the exact same hardware button indices B0 through B3. Checking the raw B0 index badge confirms whether a PC driver remapped your controller correctly or left a swapped profile active.
When troubleshooting latency across wired setups, confirm your triggers and sticks here first. Then run a USB pointer polling rate diagnostic to confirm your hub handles HID reports cleanly.
Checking analog trigger depth and dual-rumble vibration
Below the stick plots, Left Trigger (LT) and Right Trigger (RT) (or L2/R2 and ZL/ZR) track travel from 0% (0.00) to 100% (1.00). Healthy triggers rise smoothly under finger pressure and return to 0.00 on release.
Inspecting LT, RT, L2, and R2 linearity from 0.00 to 1.00
Resting triggers hovering at 0.04 or 0.08 can cause unintended braking or firing in racing and shooter titles. Conversely, a worn pad peaking at 0.85 prevents full throttle until you recalibrate trigger endpoints or replace the spring pad.
- Half-pull jitter: Hold each trigger steady at 50% travel for 3 seconds to confirm the bar stays stable without flickering.
- Zero return: Release both triggers completely and verify both numeric values settle back to
0% (0.00).
Running a 450 ms dual-rumble actuator pulse
Clicking Test vibration calls playEffect("dual-rumble") through the MDN GamepadHapticActuator Reference when vibrationActuator is exposed. The 450 ms pulse starts with 0 ms delay, running the weak motor at 65% (0.65) and strong grip motor at 80% (0.8).
If your controller stays silent, check whether a console bridge app or macOS Bluetooth profile hides haptic endpoints. Testing wired USB usually unlocks dual-rumble in Chromium, and you can verify audio output with our Speaker and stereo channel test.
Potentiometer vs Hall Effect sticks and deadzone tuning
Standard carbon-film potentiometer gimbals rub a metal wiper across a resistive track, which eventually wears down and causes permanent Axis X or Axis Y offset. Magnetic Hall Effect and TMR sensors measure field strength contactlessly, holding tight zero centers and cleaner circularity over millions of cycles.
Computing recommended deadzone percentages from idle noise
While a stick rests below 0.35 magnitude, the tester continuously records its highest Drift / Mag spike. It converts that idle peak into a suggested Deadzone percentage between 2% and 35% by adding a 2% margin above raw sensor noise.
| Observed idle magnitude | Circularity error | Recommended deadzone | Likely hardware state |
|---|---|---|---|
0.000 to 0.025 |
1% to 5% |
2% to 5% |
Healthy Hall Effect or fresh factory module |
0.025 to 0.070 |
6% to 14% |
5% to 9% |
Normal broken-in potentiometer stick |
0.070 to 0.160 |
14% to 22% |
9% to 18% |
Worn wiper track needing larger in-game deadzone |
Above 0.160 |
Over 22% |
18% to 35% |
Severe stick drift; clean sensor or replace module |
Click Reset circularity after blowing compressed air around the gimbal or recalibrating in manufacturer software to verify whether idle noise dropped. Leaving the stick untouched for 3 seconds confirms whether the resting baseline stabilized.
Tip: Wiggle each stick gently and let it snap back softly from four directions rather than flicking it hard, because weak centering springs often stop short by
0.05to0.12even when the sensor is clean.
Troubleshooting non-standard mappings and wireless dropouts
If the header reports Mapping: non-standard or buttons light up on wrong tiles, close Steam Desktop Configuration, DS4Windows, or third-party remappers that intercept raw HID packets. Low battery voltage on wireless Bluetooth gamepads can also freeze Active polling frames or drop haptic commands mid-test.
When your controller passes every check but your desk mouse skips wheel detents during browser menus, verify the mouse encoder separately. Run a quick diagnostic to catch faulty scroll encoder steps mid-game before replacing hardware.