chihirobelmo / FalconBMS-Alternative-Launcher

Configure and save FalconBMS setup per Joysticks.
Other
130 stars 30 forks source link

Button and Axis mappings are too easy to get lost #105

Open arithex opened 1 year ago

arithex commented 1 year ago

from https://forum.falcon-bms.com/topic/25538/button-mapping-gets-lost-4-37

It looks like, the way AL identifies each device, when saving its XML files, is different than the way BMS does… AL is using the “device instance guid” from the OS (or is this something made up by DirectInput?) … which is subject to change when devices are unplugged/replugged into different USB ports.

BMS uses the “productId+vendorId” which is obviously much more stable… but can be ambiguous if you have 2+ of same device.

Here's the fix I'd propose:

1- continue writing the XML files with deviceInstanceGuid, as today

2- also write same XML file, named with the "pidvid" id (as written to DeviceSorting.txt) .. maybe also append a zero-based index num

3- upon startup.. if a particular deviceInstanceGuid XML file is not found -- try to look for a "{devicePidVid}{indexNum}.xml" file, and load that

4- lastly, if no suitable savefiles are found, look for a matching stock-template