Im writing some software that takes input from USB Joystick boards like these http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=94&products_id=204
The devices are recognised by GameInputManager no problem and I can read the buttons without issue.
The problem I have is that the systems my software must work with may have more than one of these controllers connected. So I need to be able to have Button #1 on the first device perform action X, and Button #1 on the second device to perform action Y.
The problem is that the GameInputManager just shows these devices using the same name, so I cant distinguish between them in code. Its fine on first run and setup using the GameInputDevices index , however if the USB devices are removed, or plugged into different USB sockets etc., the next time my app runs, I cant guarantee each device will have the same index, therefore I cant be sure I am using the correct button on the correct device for each action.
These boards all have unique serial numbers that allow you to distinguish between them in code when more than one is used, however it appears that GameInputDevice does not allow you to read a USB devices serial number.
I have tried using the MBS class HIDAPIDeviceMBS and I can read all the relevant data about a device, including serial number, internal object handle etc. The problem I have is that I cant work out how the data I read from the USB boards converts into elements like Button #1, Button #2 etc. Reading the USB HID specs, it say I should be able to obtain a feature list from the device itself, however using the GetFeatureReport seems to only return identical data to the Read method, so Im not sure how I work out how many buttons the device has etc.
Any ideas if I can get the USB devices serial number using GameInputManager, or indeed get the internal object handle for a GameInputManager device? If I could get the handle from GameInputManager and HIDAPIDeviceMBS, then I could use MBS to get the serial etc. and match the handle it gives me to that of the GameInputManager device to ensure Im getting input from the device I think I am (if the handles would even be the same?).
Anyone have any ideas?