SDL_HINT_HIDAPI_IGNORE_DEVICES(3)

✨ SDL_HINT_HIDAPI_IGNORE_DEVICES ✨

okay bestie, welcome to another episode of the SDL3 functions manpage saga πŸŽ€ this one lives in the SDL3 FUNCTIONS corner of the manual and it's literally about telling SDL which USB devices to pretend don't exist. iconic behaviour honestly πŸ’…


🌸 NAME 🌸

SDL_HINT_HIDAPI_IGNORE_DEVICES β€” a variable containing a list of devices to ignore in SDL_hid_enumerate().

no cap, that's the whole vibe. you hand it a list, SDL skips those devices like they're not in the group chat 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_hints.h>

#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES"

πŸ’– DESCRIPTION πŸ’–

so the format of the string is a comma separated list of USB VID/PID pairs in hexadecimal form, like this:

0xAAAA/0xBBBB,0xCCCC/0xDDDD

each pair is a vendor ID and a product ID, slash between them, commas between the pairs. simple. clean. slay ✨

for example, if you wanted to ignore the Shanwan DS3 controller and any Valve controller, you might use the string:

"0x2563/0x0523,0x28de/0x0000"
🫢 this hint can be set anytime. no timing drama, no "only before init" nonsense. set it whenever, bestie.

πŸ‘‘ AVAILABILITY πŸ‘‘

this hint is available since SDL 3.2.0. if you're on anything older, it's giving "not invited to the party" 😭


and that's the tea πŸ“ this page came to you from the lovely people at Simple Directmedia Layer, and it's from the SDL 3.4.18 era of the docs. go forth and ignore some devices, bestie, you've got this πŸ’œ

πŸ“¦ where this page comes from