SDL_GETGAMEPADSTRINGFORBUTTON(3)
π SDL_GetGamepadStringForButton(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today we're doing the cutest little enum-to-string glow-up you've ever seen β¨
πΈ NAME πΈ
SDL_GetGamepadStringForButton β the way that you take an SDL_GamepadButton enum and turn it into a string. literally just enum β string, no cap π
π SYNOPSIS π
#include <SDL3/SDL_gamepad.h>
const char * SDL_GetGamepadStringForButton(SDL_GamepadButton button);
β¨ FUNCTION PARAMETERS β¨
buttonβ an enum value for a givenSDL_GamepadButton. that's it, that's the whole input, she's lowkey simple like that π¦
π« RETURN VALUE π«
you get back a string for the button you asked about π«Ά β but if you hand her an invalid button, she returns NULL, so check that before you go using it, fr fr π
and the string she gives you? it's in the format used by SDL_Gamepad mapping strings. so it's not just any string, it's that string, iykyk π
π§΅ THREAD SAFETY π§΅
it is safe to call this function from any thread. any of them. all of them. go wild, bestie πβ¨
ποΈ AVAILABILITY ποΈ
this function is available since SDL 3.2.0. so if you're on something older, no she is not there, sorry π₯²
π SEE ALSO π
SDL_GetGamepadButtonFromString(3)β the reverse girly, go check her out π
not me making an entire manual page about one function and being obsessed with her π she's iconic, she's efficient, she ate and left no crumbs π
Simple Directmedia Layer Β· SDL 3.4.18 β mwah, love u, go read the other pages, this diva of a manual was served to you fresh πππ¦π
π¦ 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