table of contents
- trixie 3.2.10+ds-1
- testing 3.2.26+ds-1
- unstable 3.2.26+ds-2
- experimental 3.3.2+git20251103~dc5b136+ds-1
| SDL_GetGamepadAxis(3) | SDL3 FUNCTIONS | SDL_GetGamepadAxis(3) |
NAME¶
SDL_GetGamepadAxis - Get the current state of an axis control on a gamepad.
SYNOPSIS¶
#include <SDL3/SDL_gamepad.h>
Sint16 SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
DESCRIPTION¶
The axis indices start at index 0.
For thumbsticks, the state is a value ranging from -32768 (up/left) to 32767 (down/right).
Triggers range from 0 when released to 32767 when fully pressed, and never return a negative value. Note that this differs from the value reported by the lower-level SDL_GetJoystickAxis(), which normally uses the full range.
Note that for invalid gamepads or axes, this will return 0. Zero is also a valid value in normal operation; usually it means a centered axis.
FUNCTION PARAMETERS¶
RETURN VALUE¶
Returns axis state.
THREAD SAFETY¶
It is safe to call this function from any thread.
AVAILABILITY¶
This function is available since SDL 3.2.0.
SEE ALSO¶
| SDL 3.3.3 | Simple Directmedia Layer |