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

Change maximum number of joystick buttons allowed by the mapper. #4596

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

mattcaron
Copy link
Contributor

Modern sticks (particularly throttles) have more than 32 buttons. See VKB STECS and Virpil Mongoose for examples.

What issue(s) does this PR address?

I was getting duplicate button presses when trying to map on my VKB STECS. Turns out it was wrapping after button 31.

Does this PR introduce new feature(s)?

No.

Does this PR introduce any breaking change(s)?

Yes. Any existing mapper files which map over 32 buttons will no longer function correctly because the buttons will no longer wrap.

For example, if a user mapped button 33 before this change, this would have wrapped to button 1 (33 % 32 = 1), so it would have gotten mapped as button one. After this change, it will no longer wrap, so the existing bind won't work, they'd have to rebind it properly.

If this is objectionable, we can introduce a "max joystick buttons" config parameter which is defaulted to 32 for the old behavior. Users could then increase this value to allow for more buttons.

Additional information

There is a performance impact as we are now polling 3x the number of button inputs. I tested this for about half an hour in Jane's ATF and any latency added was imperceptible to me on a Ryzen 7 3700X. Not sure how it would behave on something slower.

If this performance hit is objectionable, the "max joystick buttons" parameter described above can be similarly used to mitigate this too - set it to the number of buttons one actually has, and then you only incur the polling penalty for exactly that number of buttons.

Modern sticks (particularly throttles) have more than 32 buttons. See
VKB STECS and Virpil Mongoose for examples.
@Torinde
Copy link
Contributor

Torinde commented Nov 11, 2023

Related: #4594

@joncampbell123 joncampbell123 merged commit 17936c1 into joncampbell123:master Nov 11, 2023
@mattcaron
Copy link
Contributor Author

Thanks @Torinde, it was late and I forgot to reference the conversation.

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.

None yet

3 participants