I am using Windows.Gaming.Input.RawGameController to receive input from gamepads, joysticks and similar devices. https://learn.microsoft.com/en-us/uwp/api/windows.gaming.input.rawgamecontroller?view=winrt-22621
For my application, the input devices are used as "button boxes" or hotkeys. The user can select which action he wants to perform, and then press a button on his gamepad to link that button to that action.
To persist the hotkeys, and to distinguish two similar devices (e.g. two Xbox360 controllers) I need to be able to uniquely identify devices.
For now, I am using the NonRoamableId property, which at least unique identifies a device on the same PC, on the same application: https://learn.microsoft.com/en-us/uwp/api/windows.gaming.input.rawgamecontroller.nonroamableid?view=winrt-22621
Unfortunately, as the docs also say: the NonRoamableId does not remain the same between applications.
In my case, I have two applications that need to identify the same controller:
- App1 is the application where the user sets up his hotkeys and where I link a device button press to a certain action. App1 should not react to the device buttons at all, it is merely for making the link.
- App2 is another application which is listening for the button presses and executes the linked actions.
App1 and App2 are both built by me, in the same .NET Solution, but they are different projects, different executables, and simply separate applications in the end.
Is there any way at all for me to identify a device uniquely between when it is used in App1 and App2?
The NonRoamableIds look as follows for the two apps and two controllers:
App1, controller 1: {wgi/nrid/P^8c_LU-?Ci-Rc92m-X>TK-O1gQ>-h;W65QeX}
App1, controller 2: {wgi/nrid/IgJ-C]mORW-`7eT-dHNX?KA-CUg-g;`<=Va-5R}
App2, controller 1: {wgi/nrid/oS?N8;75-01ckAIO-LV<SCT-e8`?F8-OVA;K}
App2, controller 2: {wgi/nrid/b6[S7k->8dW-Y\J-PF[;kC-^7;-?CbWg-`kUb`}
There seems to be nothing in there I can use at all.
Is this simply impossible???