SDL_GetKeyFromName(3)
π SDL_GetKeyFromName(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we take a cute lil human-readable name and turn it into an actual key code. yes, that's the whole gig. it's giving translator energy. π
β¨ NAME β¨
SDL_GetKeyFromName β get a key code from a human-readable name. that's it, that's the function, she's simple but she works. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_keyboard.h>
SDL_Keycode SDL_GetKeyFromName(const char *name);
look at her. one parameter. one return. no drama. main character energy fr fr. π
π FUNCTION PARAMETERS π
nameβ the human-readable key name. like, the actual words a human would say out loud. bestie, she speaks people. π£οΈ
πΈ RETURN VALUE πΈ
She hands you back a key code β yay! π But if the name was giving absolutely nothing recognizable, you get SDLK_UNKNOWN instead. π and if you're sitting there like "okay but why tho", call SDL_GetError() for more information. she'll tell you. π«Ά
π THREAD SAFETY π
This function is not thread safe. do not try to run her from multiple threads at once, bestie, she will not survive that. no cap. π«π§΅
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, she simply does not exist yet. sorry babe. π
π SEE ALSO π
iykyk β the whole keyboard-name squad, all linked up. go read them too, they're iconic. π
and that's a wrap! this page came to you courtesy of Simple Directmedia Layer, running SDL 3.4.18, and yes she's still out here in SDL_GetKeyFromName(3) form. mwah. take care of her. πβ¨π
π¦ 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