SDL/examples/input/03-gamepad-polling
Ryan C. Gordon d7e25c92c0
Some checks are pending
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions
examples/input/03-gamepad-polling: Render axes in blue.
It's easier to see against white than yellow was.
2026-06-19 14:35:10 -04:00
..
gamepad-polling.c examples/input/03-gamepad-polling: Render axes in blue. 2026-06-19 14:35:10 -04:00
onmouseover.webp examples/input/03-gamepad-polling: Render axes in blue. 2026-06-19 14:35:10 -04:00
README.txt examples/input/03-gamepad-polling: Added some README notes about the web. 2025-09-07 11:48:53 -04:00
thumbnail.png examples/input/03-gamepad-polling: Render axes in blue. 2026-06-19 14:35:10 -04:00

This example code looks for the current gamepad state once per frame,
and draws a visual representation of it. See 01-joystick-polling for the
equivalent example code for the lower-level joystick API.

Please note that on the web, gamepads don't show up until you interact with
them, so press a button to "connect" the controller.

Also note that on the web, gamepad triggers are treated as buttons (either
pressed or not) instead of axes (pressed 0 to 100 percent). This is a web
issue, not an SDL limitation.