SDL_GetScancodeFromName(3)

πŸ’– SDL_GetScancodeFromName πŸ’–

okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and it's literally all about turning a cute lil human-readable name into a scancode. yes. that's the whole vibe. let's get into it 🫢


✨ NAME ✨

SDL_GetScancodeFromName β€” bestie, it gets you a scancode from a human-readable name. that's it, that's the gig πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_keyboard.h>

SDL_Scancode SDL_GetScancodeFromName(const char *name);

like, look at her. so clean. so iconic. πŸ‘‘


🌸 FUNCTION PARAMETERS 🌸

  • name β€” the human-readable scancode name. yes queen, you just hand her a name that a whole entire human can read, and she does the rest πŸ’–

⭐ RETURN VALUE ⭐

she hands you back the SDL_Scancode, obviously. but not me when the name wasn't recognized β€” then you get SDL_SCANCODE_UNKNOWN instead 😭 and if you wanna know why it flopped, call SDL_GetError() for more information. she always tells you what went wrong. communication queen fr fr 🫢


πŸ¦‹ THREAD SAFETY πŸ¦‹

this function is not thread safe, bestie. do not pass her around the group chat from multiple threads at the same time. she's a one-conversation-at-a-time kind of girl πŸ’€

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0 ✨ so if you're on anything older, it's giving not found, iykyk.


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, all linked up πŸ§šπŸ’œ


and that's the page, bestie!! brought to you by Simple Directmedia Layer 🌈 β€” SDL 3.4.18 era, and this is the SDL_GetScancodeFromName(3) girl herself signing off πŸ’…πŸŽ€ bye mwah 😘

πŸ“¦ where this page comes from