SDL_GetMouseNameForID(3)

πŸ’– NAME πŸ’–

SDL_GetMouseNameForID β€” bestie, this one gets the name of a mouse. That's it. That's the whole job. 🐭✨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_mouse.h>

const char * SDL_GetMouseNameForID(SDL_MouseID instance_id);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so real talk: you hand it a mouse, it hands you back a name. Iconic behaviour, honestly.

But heads up β€” if the mouse doesn't have a name, this function returns "". Like, the empty string. Not NULL. An empty little nothing of a string. Don't get it twisted, bestie πŸ’…


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • instance_id β€” the mouse instance ID. That's the ID of the mouse you're asking about. Yes, the mouse. 🐁

✨ RETURN VALUE ✨

It returns the name of the selected mouse πŸŽ‰ β€” or NULL on failure, in which case you gotta call SDL_GetError() for more info. Like, go ask the error, she knows what happened. 😭

NULL means something went wrong. "" means the mouse just doesn't have a name. Two completely different vibes, do not conflate them, iykyk.

🧚 THREAD SAFETY 🧚

This function should only be called on the main thread. Main character energy only. If you're on some other thread trying to call this, no you're not. πŸ™ˆ


🌈 AVAILABILITY 🌈

This function has been available since SDL 3.2.0. So if you're on something older... girl. Upgrade. πŸ‘‘


⭐ SEE ALSO ⭐

  • SDL_GetMice(3) β€” the whole squad. Get the entire mouse roster, not just one. 🫢

And that's the tea, bestie β˜• This page is from the Simple Directmedia Layer era, SDL 3.4.18 edition. Go name some mice, slay, periodt. πŸ’…πŸ’–πŸ”₯

πŸ“¦ where this page comes from