SDL_SetScancodeName(3)
β¨ SDL_SetScancodeName β¨
okay bestie, we're deep in the SDL3 FUNCTIONS section of the manual and this one is a lil cutie π it lives in SDL_keyboard.h and it's all about giving a scancode a human-readable name, like giving your blorbo a nickname. iconic behavior honestly.
πΈ NAME πΈ
SDL_SetScancodeName β set a human-readable name for a scancode. no cap, that's literally the whole job π
π SYNOPSIS π
#include <SDL3/SDL_keyboard.h>
bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
π¦ FUNCTION PARAMETERS π¦
scancodeβ the desiredSDL_Scancode. like, which key are we naming, bestie? πnameβ the name to use for the scancode, encoded as UTF-8. and okay listen, this part is important: the string is not copied, so the pointer you hand to this function has to stay valid for as long as SDL is being used. like it's not taking a screenshot of your string, it's holding your hand the whole time. don't let go π«Ά
π RETURN VALUE π
Returns true on success or false on failure. and if it fails? call SDL_GetError() for more info, she'll tell you what went wrong π
π THREAD SAFETY π
This function is not thread safe. so pls don't be sharing her across threads, that's giving chaos π
β AVAILABILITY β
This function is available since SDL 3.2.0. vintage-ish but not ancient, we love a recent queen π
π« SEE ALSO π«
SDL_GetScancodeName(3)β the read-only sibling, the getter to this setter, the other half of the duo π
and that's the whole page, bestie!! go forth and name ur scancodes, just keep that pointer alive fr fr π§ββοΈ
mwah π this was Simple Directmedia Layer, SDL 3.4.18, and the page is dated SDL_SetScancodeName(3). periodt. π β¨
π¦ 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