uniquely identifying a controller

How do I uniquely identify a controller between application runs? It seems multiple controllers can have the same name, port number, and port type and can even both contain the same component id.

It seems DirectInput provides a GUID and I assume other platforms provide some identifier. Is this or can this be made available through the JInput API?

Hi

JInput is cross platform, so no GUIDs will ever be exposed. Are the GUIDs the same between reboots of the computer?, if you unplug the controller and plug it in to another port does the GUID remain constant?

I suspect not, which would show that individual controllers cannot be uniquely identified reliably.

It’s something I’ve considered before, and it’s not an easy one to solve.

Endolf

For DirectInput, DIDEVICEINSTANCE has guidInstance which uniquely identifies a controller between program runs on the same computer:
http://doc.51windows.net/Directx9_SDK/?url=/directx9_sdk/input/ref/structs/dideviceinstance.htm

The GUID could just be exposed as a string. Whatever identifier on other platforms could also be exposed as a string (eg, even if numeric). I am sure other platforms have a similar identifier.