-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Allow interpreting JoyAxis as JoyButton #80944
Conversation
60d1910
to
8e0a125
Compare
8e0a125
to
a54c709
Compare
float previous_value = 0.0; | ||
}; | ||
|
||
LocalVector<LocalVector<JoyAxisButtonMapping>> axis_to_button_mapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not HashMap<int, LocalVector>
?
EDIT:
Actually LocalVector might be faster, idk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression, that LocalVector
was more appropriate than HashMap
, because I can access the content by integer indices, so there is no need for creating the hash values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, but looks fine overall.
Let the user configure, if a JoyAxis should be interpreted as a pair of JoyButtons (negative and positive side). When an axis is configured as a button, then `InputEventJoypadButton`-events are sent instead of `InputEventJoypadMotion`-events for this axis.
a54c709
to
1ed4af4
Compare
If there's the problem that It'd be interesting to know if on non-Android platforms, there's an issues at the moment with |
As discussed in a previous PR-review meeting, there are better ways to resolve the linked issue. Closing. |
Let the user configure, if a JoyAxis should be interpreted as a pair of JoyButtons (negative and positive side).
When an axis is configured as a button, then
InputEventJoypadButton
-events are sent instead ofInputEventJoypadMotion
-events for this axis.resolve #72636
Being unfamiliar with this part of the code-base, It is likely, that I have missed some details.
MRP for testing: AxisButton.zip
