SDL_MouseID(3type)

πŸ’– SDL_MouseID πŸ’–

okay bestie, welcome to the SDL_MouseID page β€” that's the one from the SDL3 DATATYPES crew, and it is literally so simple you're gonna slay it in like thirty seconds. no cap.


✨ NAME ✨

SDL_MouseID β€” it's a unique ID for a mouse, valid for as long as that mouse stays connected to the system. and the important part, the part that's giving ✨iconic✨: it is never reused for the entire lifetime of the application. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_mouse.h>

typedef Uint32 SDL_MouseID;

that's it. that's the whole thing. a Uint32 wearing a little name tag. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's short tea:

  • if the mouse gets disconnected and then reconnected, it will get a new ID. like, it came back but it's a different girl now. πŸ’…
  • the value 0 is an invalid ID. zero is not a mouse. zero is nothing. zero is the void. do not trust zero. πŸ’€

that's the whole description. no hidden lore, no weird edge cases, just those two facts. iykyk.


🌸 AVAILABILITY 🌸

this datatype has been available since SDL 3.2.0. so if you're on something older, sorry babe, it's not there yet 😭


lowkey a reminder: the ID lives as long as the application does, so don't go recycling it for some other mouse, that's not the vibe. 🚫🐭

and that's a wrap, gorgeous πŸ’œ this page came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's filed under SDL_MouseID(3type) in the SDL3 DATATYPES section. go forth and identify your mice correctly. you ate. πŸ“πŸ‘‘

πŸ“¦ where this page comes from