SDL_JoystickGetButton(3)
๐ SDL_JoystickGetButton ๐
okay bestie, quick lil intro before we get into it: this page lives in the SDL API Reference manual, and it's about checking whether a button on a joystick is, like, being pressed right now. that's the whole vibe. ๐ฎโจ
๐ธ NAME ๐ธ
SDL_JoystickGetButton โ get the current state of a given button on a given joystick ๐
โจ SYNOPSIS โจ
#include "SDL.h"
Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
like yes, that's the whole thing, she's short and she knows it ๐
๐ฆ DESCRIPTION ๐ฆ
so SDL_JoystickGetButton returns the current state of the given button on the given joystick.
that's it. that's the function. no cap. you hand her a joystick and a button, she tells you what's up with that button at this exact moment. iconic behaviour honestly ๐
๐ RETURN VALUE ๐
1if the button is pressed ๐- otherwise,
0๐ญ
literally a binary moment. pressed or not pressed, no in-between, no "kinda", no "it depends". slay.
๐ SEE ALSO ๐
SDL_JoystickNumButtonsโ for when you need to know how many buttons you're even allowed to ask about ๐ซถ
and that's the tea, bestie!! this page came from the SDL manual, dated Tue 11 Sep 2001, 23:00 โ yeah she's an elder but she's still serving โจ go press some buttons, you got this ๐ ๐
๐ฆ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 ยท LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms