Get the current state of a button on a gamepad.
Defined in <SDL3/SDL_gamepad.h>
bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
SDL_Gamepad * | gamepad | a gamepad. |
SDL_GamepadButton | button | a button index (one of the SDL_GamepadButton values). |
(bool) Returns true if the button is pressed, false otherwise.
This function is available since SDL 3.1.3.