-
Notifications
You must be signed in to change notification settings - Fork 329
FIX: Sort out controls which are not contained in event for AnyButtonPressed event (ISXB-1005) #2249
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
base: develop
Are you sure you want to change the base?
FIX: Sort out controls which are not contained in event for AnyButtonPressed event (ISXB-1005) #2249
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #2249 +/- ##
===========================================
+ Coverage 76.70% 76.72% +0.01%
===========================================
Files 465 465
Lines 87919 87944 +25
===========================================
+ Hits 67442 67471 +29
+ Misses 20477 20473 -4 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Looks like a simple one liner and good to have yet another test for this!
|
||
[Test] | ||
[Category("Events")] | ||
public void Events_OnAnyButtonPressed_FiltersOutOtherControls() |
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.
Great to have a test. I assume this test would fail before your change, right?
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.
yes!
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.
Looks good, thanks for looking into this.
Did not forget this one, taking a look today |
Description
This PR fixes an issue where InputSystem.anyButtonPress is triggered multiple times if another control of the same device is actuated while holding a button down. This is also reproducible on gamepads that receive events constantly, holding a button down then produces one anyButtonPress event per frame.
This was due to the fact that all controls of the device contained in the event were checked for actuated buttons, not only the control triggering the event. Then the magnitude check of the button causes the trigger of the callback over and over again.
This is prevented by the newly added line of code which checks if the control is the same as from the InputEvent.
This issue is fixed with the PR too.
Testing status & QA
Manual testing with Test project of customers.
Overall Product Risks
Low
Comments to reviewers
The documentation states that the callback is only triggered once per button press.
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: