DOKK / manpages / debian 13 / libsdl3-doc / SDL_GetJoystickButton.3.en
SDL_GetJoystickButton(3) SDL3 FUNCTIONS SDL_GetJoystickButton(3)

SDL_GetJoystickButton - Get the current state of a button on a joystick.

Defined in SDL3/SDL_joystick.h

#include "SDL3/SDL.h"
bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button);

an SDL_Joystick
structure containing joystick information.
the button index to get the state from; indices start at index 0.

Returns true if the button is pressed, false otherwise.

This function is available since SDL 3.2.0.

(3), SDL_GetNumJoystickButtons(3)

SDL 3.2.10 Simple Directmedia Layer