SDL_hid_device_info(3type)
π SDL_hid_device_info β the tea on your HID devices
okay so bestie, welcome to SDL3 DATATYPES, and today's main character is SDL_hid_device_info π β it's the lil struct that spills everything about a connected HID device. yes, the whole vibe. every field. let's get into it β¨
β¨ NAME β¨
SDL_hid_device_info β literally just Information about a connected HID device π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hidapi.h>
typedef struct SDL_hid_device_info
{
/** Platform-specific device path */
char *path;
/** Device Vendor ID */
unsigned short vendor_id;
/** Device Product ID */
unsigned short product_id;
/** Serial Number */
wchar_t *serial_number;
/** Device Release Number in binary-coded decimal,
also known as Device Version Number */
unsigned short release_number;
/** Manufacturer String */
wchar_t *manufacturer_string;
/** Product string */
wchar_t *product_string;
/** Usage Page for this Device/Interface
(Windows/Mac/hidraw only) */
unsigned short usage_page;
/** Usage for this Device/Interface
(Windows/Mac/hidraw only) */
unsigned short usage;
/** The USB interface which this logical device
represents.
Valid only if the device is a USB HID device.
Set to -1 in all other cases.
*/
int interface_number;
/** Additional information about the USB interface.
Valid on libusb and Android implementations. */
int interface_class;
int interface_subclass;
int interface_protocol;
/** Underlying bus type */
SDL_hid_bus_type bus_type;
/** Pointer to the next device */
struct SDL_hid_device_info *next;
} SDL_hid_device_info;
π DESCRIPTION π
no cap, this struct is the whole dossier on one HID device. here's the field-by-field breakdown, because every single one of these matters and I'm not gatekeeping π
char *pathβ the platform-specific device path. it's giving "where u at" but for hardware.unsigned short vendor_idβ the Device Vendor ID π·οΈunsigned short product_idβ the Device Product ID π·οΈwchar_t *serial_numberβ the Serial Number π’unsigned short release_numberβ the Device Release Number in binary-coded decimal, also known as the Device Version Number. two names, one field, iconic behavior honestly πwchar_t *manufacturer_stringβ the Manufacturer String πwchar_t *product_stringβ the Product string π¦unsigned short usage_pageβ the Usage Page for this Device/Interface. Windows/Mac/hidraw only, so don't come for it on other platforms πunsigned short usageβ the Usage for this Device/Interface. also Windows/Mac/hidraw only bestie, same rules apply π«Άint interface_numberβ the USB interface which this logical device represents. valid only if the device is a USB HID device, and it's Set to -1 in all other cases. so like, check before u assume βint interface_classβ Additional information about the USB interface. valid on libusb and Android implementations β¨int interface_subclassβ also Additional information about the USB interface, same deal: libusb and Android implementations only.int interface_protocolβ yeah bestie, also Additional information about the USB interface, and again valid on libusb and Android implementations.SDL_hid_bus_type bus_typeβ the Underlying bus type π no literally, bus type.struct SDL_hid_device_info *nextβ a Pointer to the next device π it's a linked list, the way that it just chains them together... obsessed.
heads up:interface_numberis-1whenever the device isn't a USB HID device, andusage_page/usageare only a thing on Windows, Mac and hidraw. don't be surprised, it's in the struct comments fr fr.
π AVAILABILITY π
This struct is available since SDL 3.2.0 β¨
okay that's the whole page, you ate that π go forth and enumerate ur HID devices with main character energy. iykyk π
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_hid_device_info(3type) β mwah, catch u in the next manpage 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