SDL_hid_get_properties(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– SDL_hid_get_properties πŸ’–

okay bestie, gather round, because this one is from the SDL3 FUNCTIONS collection and it's lowkey a little key to a whole secret drawer of info πŸ”‘


✨ NAME ✨

SDL_hid_get_properties β€” get the properties that are associated with an SDL_hid_device. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hidapi.h>

SDL_PropertiesID SDL_hid_get_properties(SDL_hid_device *dev);

like. look at her. one argument, returns a property ID. no cap, she's simple and she's perfect 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so SDL is gonna hand you the following properties, and listen β€” these are read-only, meaning you can look but do NOT touch, okay? πŸ‘€

  • SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER β€” this is the libusb_device_handle that's associated with the device, but only if it was opened using libusb. no libusb, no handle, that's the vibe 🧚

that's the whole list. short and iconic, we love a minimal queen πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • dev β€” a device handle, and specifically one that was returned from SDL_hid_open(). don't just be passing her any random pointer, bestie, she came from SDL_hid_open() and that's the whole lore 😭

πŸ’œ RETURN VALUE πŸ’œ

she returns a valid property ID on success ✨ or 0 on failure πŸ’€

and if you got that 0? don't panic, just call SDL_GetError() for more information, because she will absolutely tell you what went wrong 🫢


🌈 AVAILABILITY 🌈

this function has been available since SDL 3.4.0. if you're on anything older, she simply is not there, sorry babe πŸ™ˆ


fr fr: read-only properties, 0 means failure, and SDL_GetError() is your bestie when things go sideways. the way that this function has exactly one property and still ate? iconic. periodt πŸ’…βœ¨

and that's a wrap, gorgeous πŸ’– this page came to you from the Simple Directmedia Layer crew, it's SDL 3.4.18, and yeah, the whole thing is filed under SDL_hid_get_properties(3). go forth and get those properties, queen πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from