How Do Game Controllers Work?
Modern gamepads use a combination of analog and digital inputs. Analog sticks use potentiometers or Hall effect sensors to detect position in two axes (X and Y). Buttons are digital switches that report pressed/released states. Triggers on Xbox and PlayStation controllers are analog, reporting pressure from 0 to 1. All input data is sent to the computer via USB or Bluetooth using standard HID (Human Interface Device) protocols.
Stick Drift & Calibration
Stick drift occurs when analog sticks register input even when untouched — a common issue caused by worn potentiometers. Most games apply a dead zone — a small area around center that's ignored — to compensate. This test shows raw axis values, making drift visible. If your sticks don't return to exactly 0.00 when released, there may be slight drift.
Gamepad API
The Gamepad API allows web browsers to detect and read input from game controllers. It uses a polling model — the browser reads the gamepad state each frame using navigator.getGamepads(). The API reports button states, axis positions, and device information. It supports vibration through the Vibration Actuator interface on compatible controllers.