SDL_GamepadHasButton(3)
πΈ SDL_GamepadHasButton πΈ
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, today's main character is SDL_GamepadHasButton β she just wants to know one thing: does ur gamepad have this button or not π
β¨ NAME β¨
SDL_GamepadHasButton β literally just asking whether a gamepad has a given button. that's it. that's the whole job π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_gamepad.h>
bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
π DESCRIPTION π
okay so here's the tea, and it's important tea: this function merely reports whether the gamepad's mapping defined this button. that is all the information SDL has about the physical device. like, SDL can't peek inside ur controller and count the little plastic buttons, she only knows what the mapping told her. so don't come for her if the vibes are off, she's working with what she's got π
π FUNCTION PARAMETERS π
gamepadβ a gamepad. yes queen, just a gamepad π«Άbuttonβ a button enum value (anSDL_GamepadButtonvalue).
β RETURN VALUE β
returns true if the gamepad has this button, false otherwise. binary. iconic. periodt π
π THREAD SAFETY π
it is safe to call this function from any thread. no cap, she's not gonna ghost you halfway through, call her from wherever fr fr π§
π AVAILABILITY π
this function is available since SDL 3.2.0. if ur on anything older, she simply did not exist yet, sorry bestie π
π SEE ALSO π
SDL_GamepadHasAxis(3)β same energy, different body part. go read her too, she's also slaying π
lowkey reminder: the mapping is the whole source of truth here. no mapping, no button. that's the vibe check π₯
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_GamepadHasButton(3) β mwah, that's the whole page, thanks for coming to my ted talk, love u, bye bestie πβ¨ππ¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms