1

My situation is that I have multiple joystick input devices, from the same manufacturer. The idea is that you set them up once, and then any user could log in and play without having to set them up again. The problem is how to uniquely identify each stick so at runtime you associate each stick to the correct saved configuration. I'm using DirectInput since these are joysticks, not gamepads.

The problem is that despite what is claimed here as well as other MSDN pages, the InstanceGUID is only unique per user, not per machine! At least this is what I am seeing, which seems to be corroberated by one other poster here. Ideally I want a new user to be able to log in and just run with the existing setup, but I don't see any way to associate the correct joystick to the correct saved button mapping without a reliable GUID that doesn't change (and that isn't the same for both sticks, like the product GUID).

All these sticks are USB joysticks if that helps.

Maybe there's a way to reliably enumerate the sticks? But without understanding the underlying architecture of how the USB ports are scanned for Joysticks, I'm not sure if I can always assume the "first" stick will actually be the first for every user, or if I unplug a stick and plug it back in, even to the same port.

UPDATE: This article contains the claim that InstanceId is per computer, not per user.

Community
  • 1
  • 1
obermeister
  • 89
  • 1
  • 8
  • Please let us know which language you are referring to. There are plenty of ways to enumerate USB devices but we need to know what your using – Jwit May 06 '14 at 18:09
  • I'm actually using both C# and C++. Basically, the app that configures the joysticks is a C# GUI, and the app that actually plays the game is C++. On both ends I need to enumerate the joysticks and correctly associate them with the saved button mappings. – obermeister May 06 '14 at 18:29

0 Answers0