SDL_GetGamepadButton - Get the current state of a button on a gamepad.
Contents
Availability
This function is available since SDL 3.2.0.
Function Parameters
gamepad
a gamepad.
button a button index (one of the SDL_GamepadButton values).
Name
SDL_GetGamepadButton - Get the current state of a button on a gamepad.
Return Value
Returns true if the button is pressed, false otherwise.
See Also
SDL_GamepadHasButton(3), SDL_GetGamepadAxis(3) Simple Directmedia Layer SDL 3.2.20 SDL_GetGamepadButton(3)
Synopsis
#include<SDL3/SDL_gamepad.h>boolSDL_GetGamepadButton(SDL_Gamepad*gamepad,SDL_GamepadButtonbutton);
