How to test a game controller for stick drift in your browser
Stick drift shows up as a reading when the stick is not touched. A browser can measure it from the values the controller reports, and suggest a deadzone that hides it.
Por Redação do HZBenchPublicado:
Este artigo está disponível apenas em inglês.
Browsers read controllers through the Gamepad API [1]. Each stick appears as two axes, and the specification requires axis values to be normalised to the range −1 to 1 [2][3]. A centred, untouched stick should read close to 0 on both axes. Drift is a reading that stays away from 0 when nobody is touching the stick.
What to measure
| Reading | What it tells you |
|---|---|
| Largest offset at rest | How far from centre the stick reports while untouched. This is the drift. |
| Jitter at rest | How much the reading moves while untouched. A noisy stick can trigger small movements in games. |
| Deadzone that hides it | The smallest deadzone that would ignore the rest offset, with a safety margin. |
| Largest deflection | Whether the stick reaches the edge of its range when pushed fully. |
| Difference between directions | Whether one direction reaches less far than the others. |
Step by step
- Connect the controller by cable or Bluetooth and press any button. To limit fingerprinting, browsers return no gamepads until they see an input from one [2].
- Start the stick test. Rotate the left stick slowly around its full edge twice, then the right stick.
- Let go of both sticks and do not touch the controller while the rest phase runs.
- Read the rest offset and the suggested deadzone. Save the result so you can compare it later.
How to read the result
HZBench suggests a deadzone equal to the largest rest offset plus a 10% margin. If your game's deadzone setting is at or above that value, the drift should not move your character. Range and direction differences are only shown after a full rotation; without one there is no honest way to judge the edges.
There is no universal pass mark. Compare the same controller over time: a rest offset that grows from one month to the next is more telling than any single number. HZBench does not label a controller as healthy or faulty.
What usually helps, and what to expect
- Raise the deadzone in the game to the suggested value. It hides drift at the cost of a little precision near the centre.
- Use the calibration option in your system or console settings if the controller offers one, then measure again.
- Update the controller firmware through the manufacturer's app or console.
- If the rest offset keeps growing over weeks, the stick module is wearing out. That is a repair or warranty question, and a saved history of measurements helps make the case.
What a browser cannot see
- Readings come from what the operating system and driver report. Some drivers or launchers apply their own deadzone before the browser sees the value.
- The standard layout covers common controllers [2]; unusual controllers may map sticks to other axes.
- A browser cannot open the controller or tell you why it drifts.
Fontes
- [1] Gamepad API, MDN Web Docs (acessado )
- [2] Gamepad (W3C specification), W3C (acessado )
- [3] Gamepad: axes property, MDN Web Docs (acessado )