SDL_IsJoystickVirtual(3)

๐Ÿ’– SDL_IsJoystickVirtual ๐Ÿ’–

okay bestie, so this one lives in the SDL3 FUNCTIONS section of the manual and it's genuinely so simple you'll be done reading before your iced coffee melts ๐ŸงŠ


โœจ NAME โœจ

SDL_IsJoystickVirtual โ€” the lil vibe check that tells you whether or not a joystick is virtual ๐ŸŽฎ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_joystick.h>

bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id);

๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • instance_id โ€” the joystick's instance ID. that's it, that's the whole shopping list ๐Ÿ›๏ธ

๐Ÿ’… RETURN VALUE ๐Ÿ’…

returns true if the joystick is virtual, and false if it's not. no in-between, no "it's complicated", just a clean yes or no ๐Ÿซถ


๐Ÿฆ‹ THREAD SAFETY ๐Ÿฆ‹

good news: it is safe to call this function from any thread. go wild, spawn those threads, this one will not betray you โœจ


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

this function is available since SDL 3.2.0. so if you're on anything older, it's giving "not in this timeline" ๐Ÿ˜ญ


and that's the whole page, no cap ๐Ÿงš this was pulled from the Simple Directmedia Layer docs for SDL 3.4.18, so go forth and query those joysticks, bestie ๐Ÿ’œ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from