Skip to content

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

Closed
mockersf wants to merge 2 commits intobevyengine:mainfrom
mockersf:revert-input-clear-pressed
Closed

[Merged by Bors] - input clear should not clear pressed#4418
mockersf wants to merge 2 commits intobevyengine:mainfrom
mockersf:revert-input-clear-pressed

Conversation

@mockersf
Copy link
Copy Markdown
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
@alice-i-cecile alice-i-cecile requested review from IceSentry and cart April 4, 2022 21:38
Copy link
Copy Markdown
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.

pub fn clear(&mut self) {
self.just_pressed.clear();
self.just_released.clear();
self.pressed.clear();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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