| Summary: | Device addition/removal queries all USB devices rather than only HID devices. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Andreas Ertelt <bugzilla-sdl> |
| Component: | joystick | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Windows (All) | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/214cd9137ea9 |
SDL_dxjoystick.c is setting the classguid for device (dis)connect events to USB Devices in general: dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; Wouldn't it make more sense to have it just subscribe to Hid device events? This would mean less meaningless events reaching the application - my proposed change of the line above would look like this: HidD_GetHidGuid(&dbh.dbcc_classguid); This worked fine for me in the past, but I only have a limited number of devices to test with - are there any joysticks that are connected through USB that are not classified as HID devices? It should also be noted that despite its availability since Windows 2000, the function HidD_GetHidGuid() was only recently added to the MinGW-w64 header files. Relevant references: http://msdn.microsoft.com/en-us/library/windows/hardware/ff538924%28v=vs.85%29.aspx