Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 8, 2023
Merged

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

merged 3 commits into from
Oct 8, 2023

Conversation

arithex
Copy link
Collaborator

@arithex arithex commented Jul 22, 2023

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
Copy link
Collaborator Author

arithex commented Jul 22, 2023

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. :)

Copy link
Owner

@chihirobelmo chihirobelmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chihirobelmo chihirobelmo merged commit 9401b38 into chihirobelmo:develop Oct 8, 2023
@arithex arithex deleted the bugfix/93 branch October 18, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants