SDL_HasMouse(3)

πŸ’– SDL_HasMouse πŸ’–

okay bestie, quick vibe check β€” this one lives in the SDL3 FUNCTIONS section of the manual, so you already know it's a lil' utility queen. πŸŽ€


🌸 NAME 🌸

SDL_HasMouse β€” tells you whether a mouse is currently connected. that's it. that's the whole job. she's simple, she's iconic, she ate. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_mouse.h>

bool SDL_HasMouse(void);

no arguments, no drama, just vibes and a bool. πŸ¦‹


🫢 RETURN VALUE 🫢

  • Returns true if a mouse is connected
  • Returns false otherwise

fr fr that's the entire return contract, no hidden lore. 😭


🧚 THREAD SAFETY 🧚

⚠️ bestie listen. this function should only be called on the main thread. do not try to be cute and call it from a worker thread, it's giving chaos and we don't do that here. πŸ’€

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, no mouse-checking for you, sorry babe πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_GetMice(3) β€” go get the whole lineup of mice if you need the full roster, this is the glow-up companion read πŸ’œ

and that's the tea, bestie ✨ this page is from Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, love that for us. πŸ“πŸ’–

πŸ“¦ where this page comes from