SDL_hid non joystick device

Hi, is there any way getting SDL_hid to work with a device thats not a joystick? I’m writing a OSD for a multimeter but the SDL_hid functions only ever seem to list joysticks so I can never connect to the device I need to connect to… I’d prefer to use the SDL_hid functions than include another copy of hidapi when it should be possible to use SDL’s for this purpose…

Any advice would be appreciated.

Yes, you just need to set the hint:

SDL_SetHint(SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS, "0");
3 Likes

Hi Slouken thanks for the heads up, I’ve been at this all morning, can’t seem to get this working at all even with what you have suggested. Then when I switch back to non SDL_hid functions it works? I can only assume there is a bug here. :confused:

The SDL_hid_enumerate always returns NULL even if I put in 0 for product and vender ids…

running latest SDL2.

Graham

Just used grep on the header files for the above HINT as I had to use a string, clearly not defined… its not in any header files… … either on header files installed using brew or using the .dmg from github.

Graham

Hi,

found ‘SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS’ in SDL_hints.h but it’s SDL3.

Yeah, thats not an option… it looks like it wasn’t patched into SDL2 at all.