SDL_GetJoystickProperties(3)
โจ SDL_GetJoystickProperties โจ
okay so bestie, welcome to the SDL3 FUNCTIONS section of the manual, and lemme tell you about SDL_GetJoystickProperties โ the little function that hands you the whole vibe check on a joystick ๐ฎ๐
๐ NAME ๐
SDL_GetJoystickProperties โ get the properties associated with a joystick.
like, the receipts. the lore. the whole tea on what your controller can actually do ๐ฅ
๐ธ SYNOPSIS ๐ธ
#include <SDL3/SDL_joystick.h>
SDL_PropertiesID SDL_GetJoystickProperties(SDL_Joystick *joystick);
๐ DESCRIPTION ๐
SDL is out here giving you the following read-only properties, and honestly? iconic of it. here's the full lineup, no gatekeeping ๐ซถ
SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEANโtrueif this joystick has an LED that has adjustable brightness โจ like it can dim or glow up, main character energySDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEANโtrueif this joystick has an LED that has adjustable color ๐ full rainbow mode, we love to see itSDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEANโtrueif this joystick has a player LED ๐ you know, the little "player 1" light that tells everyone who's the protagonistSDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEANโtrueif this joystick has left/right rumble ๐ shake shake shake, it's giving hapticsSDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEANโtrueif this joystick has simple trigger rumble ๐ฅ just the triggers buzzing, keeping it simple fr fr
heads up bestie: these are read-only properties. you're reading them, not setting them. don't try to change them, that's not the move ๐
๐ฆ FUNCTION PARAMETERS ๐ฆ
joystickโ theSDL_Joystickobtained fromSDL_OpenJoystick(). yes, the actual one you already opened, not a random one you found on the street ๐
โญ RETURN VALUE โญ
Returns a valid property ID on success, or 0 on failure ๐ญ and when it fails? call SDL_GetError() for more information โ that's your group chat asking "what happened" and getting the actual answer.
๐ THREAD SAFETY ๐
It is safe to call this function from any thread. no cap. go wild, thread it from everywhere, it does not care ๐
๐ AVAILABILITY ๐
This function is available since SDL 3.2.0. so if you're on something olderโฆ babe, upgrade ๐ง
and that's the whole page, you ate it ๐
signing off from Simple Directmedia Layer, running SDL 3.4.18, page SDL_GetJoystickProperties(3) โ stay slaying, bestie ๐โจ
๐ฆ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms