chihirobelmo / FalconBMS-Alternative-Launcher

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

Bugfix/93 - Fix for issue-93: shifted POV hats not working #101

Closed arithex closed 11 months ago

arithex commented 1 year ago

Although DirectInput appears to return data for up to 4 pov-hats per device, BMS only supports a total of 2 pov-hats -- so long as the key file format uses a hardcoded shift-offset of '2' for pov-hats, this seems to be an unavoidable limit.

This fix for issue-93 simplifies things further, to only support 1 hat on the primary steering (roll) device and 1 hat on the throttle (or potentially, 2 hats on the same device if it's used for both steering and throttle.. not sure any such physical devices exist? maybe vJoy).

The natural enumeration of pov-hats performed by BMS appears to honor the DeviceSorting.txt order. So, the approach taken in this PR doesn't set any of the g_nPOV cfg parameters -- rather, it simply writes out the pov-hat keyfile bindings for stick and throttle in the same relative order they appear in DeviceSorting. This should be correct in the vast majority of cases, but it leaves the user free to apply the g_nPOV cfg parameters to tweak things, if necessary.

This is another "half measures" bugfix from me. :\

A more complete fix, would be to track all the devices with hat-bindings (show a warning msgbox if more than 2) and emit the necessary g_nPOV* cfg parameters to reference them.

So, feel free to reject this PR (as always) and let me know, if you'd like I can pursue the more full fix.

arithex commented 1 year ago

Oops this PR picked up changes for issue-97 (also in PR #100). I suck at git.. which is partly why I'm here helping. :)