locked
Concerning how Windows handles the detection and configuration of a (composite) USB HID game controller device? RRS feed

  • Question

  • Hello!

    I'm sorry, I'm not even entirely sure how to convey the exact nature of my question without basically asking the question itself:

    I'm developing my own USB device for Windows. It's a composite HID device that supports up to four game controller interfaces. In short, you could think of it as a "four-player adapter" for PC that would let you plug in any combination of controllers for, e.g., PS2, Sega Genesis, Atari, and Wii simultaneously. Now I actually have this thing working (in Windows XP); it enumerates properly, four controllers show up in the game controllers applet, and I can calibrate/test each one and use all four in a game successfully. The problem I'm facing is two-fold. First, in the game controllers applet or any game listing the installed joysticks, all four joystick interfaces default to using either: the parent composite device product string (if the interfaces have no assigned strings), or the string used by the first interface (even if all four interfaces specify unique strings). Second, if I disconnect the device, change the string configuration (so say the first interface now has a different string), and plug it back in, all four joysticks retain the same string from last time. They don't change to the new string carried by the first interface until I change my device's VID/PID, or clear the registry information. I tracked down a registry key where Windows seems to cache the product id string for a given VID/PID combination, which it seems to assign either the main product ID or the ID string of the first device interface, sure enough... But the keys are identified only by VID/PID. They don't account for composite devices in the form of VID/PID/Interface#. Doing a little detective work, I sniffed some USB enumeration traffic for my device. I noticed that each and every time I plug in the device, even if it has the same VID/PID, Windows asks for, and my device responds with, the unique strings for each interface. (Why does Windows even bother asking if it won't use them?)

    I guess what I'm asking is: is it even possible for Windows/the game controllers applet/DirectInput/whatever (I'm not even sure what software to blame here) to behave the way I want? I've searched high and low for information, and the closest thing I found was a similar post in these forums a couple years ago: http://social.msdn.microsoft.com/Forums/en/gametechnologiesgeneral/thread/90fc0039-2774-4b23-b970-685aaed2ab31

    So... what would be the best forum?
    Friday, July 31, 2009 10:36 PM

Answers