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

[Merged by Bors] - input clear should not clear pressed #4418

Closed
wants to merge 2 commits into from

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Apr 4, 2022

Objective

@alice-i-cecile alice-i-cecile added this to the Bevy 0.7 milestone Apr 4, 2022
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior P-Critical This must be fixed immediately or contributors or users will be severely impacted A-Input Player input via keyboard, mouse, gamepad, and more labels Apr 4, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Unfortunately I agree with this reversion: that's a nasty bug.

I suspect the real fix to the original issue will involve dedicate input mocking tools.

@@ -120,7 +120,6 @@ where
pub fn clear(&mut self) {
self.just_pressed.clear();
self.just_released.clear();
self.pressed.clear();
Copy link
Contributor

@hymm hymm Apr 4, 2022

Choose a reason for hiding this comment

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

can you leave a comment here about why pressed is not called, so this doesn't get added again?

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot to revert the test change. I added a comment in the test

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Apr 4, 2022
@alice-i-cecile alice-i-cecile removed the S-Needs-Triage This issue needs to be labelled label Apr 4, 2022
@cart
Copy link
Member

cart commented Apr 4, 2022

Oops! This is my bad for pressing the merge button. Should have thought about this a bit more. @mockersf thanks for catching this / holding the quality bar high!

@cart
Copy link
Member

cart commented Apr 4, 2022

bors r+

bors bot pushed a commit that referenced this pull request Apr 4, 2022
# Objective

- Revert #4410 
- `Input<T>.clear()` is the method call at the end of each frame for inputs. Clearing `pressed` in it mean that checking if a key is pressed will always return false
@bors bors bot changed the title input clear should not clear pressed [Merged by Bors] - input clear should not clear pressed Apr 4, 2022
@bors bors bot closed this Apr 4, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this pull request Jun 7, 2022
# Objective

- Revert bevyengine#4410 
- `Input<T>.clear()` is the method call at the end of each frame for inputs. Clearing `pressed` in it mean that checking if a key is pressed will always return false
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Revert bevyengine#4410 
- `Input<T>.clear()` is the method call at the end of each frame for inputs. Clearing `pressed` in it mean that checking if a key is pressed will always return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior P-Critical This must be fixed immediately or contributors or users will be severely impacted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants