SDL_GetKeyboardNameForID(3)
π SDL_GetKeyboardNameForID(3) β SDL3 FUNCTIONS π
okay bestie, so like... you got a keyboard. you got an ID for that keyboard. and now you're sitting there like "girl, what is this thing even CALLED??" and honestly? valid. that's literally what this function is for, and it's part of the SDL3 fam. no cap.
β¨ SYNOPSIS β¨
#include <SDL3/SDL_keyboard.h>
const char * SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id);
πΈ DESCRIPTION πΈ
this is the "what's ur name, gorgeous?" function π you hand it a keyboard's instance ID and it gives you back the name of that keyboard.
lowkey important: if the keyboard doesn't have a name, this function returns "". like, an empty string. not a NULL. an actual empty lil string. she's just β¨namelessβ¨ and that's fine.
π FUNCTION PARAMETERS π
instance_idβ the keyboard instance ID. that's the lil number/tag thingy that tells you which keyboard we're talking about. every keyboard's got one, iykyk.
π¦ RETURN VALUE π¦
- you get the name of the selected keyboard π
- or
NULLon failure π β and if that happens, bestie, go callSDL_GetError()for more info, she'll tell you what went wrong fr fr.
π§ THREAD SAFETY π§
π¨ main thread ONLY. this function should only be called on the main thread. do not be passing this off to some random background thread, i am begging you π
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on something older... no she's not there yet, sorry babe π
π SEE ALSO π
SDL_GetKeyboards(3)β the whole squad of keyboards, if you want the full roster π
k that's the whole page, you're literally a keyboard-name-knower now, periodt π
this was brought to you by the Simple Directmedia Layer girlies, SDL 3.4.18 edition π
π¦ 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