We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3533

Summary: Enumeration joystick devices omitted during directinput enumeration
Product: SDL Reporter: white.magic
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Windows 7   

Description white.magic 2016-12-29 20:16:40 UTC
The logic which decides if a device enumerated via the direct input system in the function EnumJoysticksCallback in SDL_dinputjoystick.c is processed is discarding valid joystick devices due to the assumption that devices of the type DI8DEVTYPE_SUPPLEMENTAL are not valid devices.

This change was added with 2.0.4 with this commit http://hg.libsdl.org/SDL/rev/d5adc0c06a03 that is linked to this bug report https://bugzilla.libsdl.org/show_bug.cgi?id=2460 which indicates that in that case devices of the type DI8DEVTYPE_SUPPLEMENTAL were not desirable as they caused a singular device to emit multiple "device added" events.

Since then there appear to have been a few fixes to handle devices that fall into various other classes in the following two commits: 
http://hg.libsdl.org/SDL/rev/b9488c689ce3 and http://hg.libsdl.org/SDL/rev/161fee58e36f

Two devices I have reports of failing to be listed when the DI8DEVTYPE_SUPPLEMENTAL type is excluded are ECS Gametric Throttle and Thrustmaster MFD Cougar.

I'm unsure what the best or most desirable solution to this is as the initial change had a particular purpose, however, it also interfers with devices being properly listed that windows itself considers joystick devices. One way probably would be having a different logic to detect when a single device emits multiple "device added" events, however, I'm not familiar enough with the internals of direct input to say if that's even possible to detect.
Comment 1 Sam Lantinga 2017-01-18 20:19:13 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/b0559017b1e5