Bugfix/93 - Fix for issue-93: shifted POV hats not working #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.