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

Extend Touches with clear and reset methods #10930

Merged
merged 7 commits into from
Jan 4, 2024

Conversation

matiqo15
Copy link
Member

@matiqo15 matiqo15 commented Dec 10, 2023

Objective

Solution

  • Add function clear_just_pressed that clears the just_pressed state of the touch input.
  • Add function clear_just_released that clears the just_released state of the touch input.
  • Add function clear_just_canceled that clears the just_canceled state of the touch input.
  • Add function release that changes state of the touch input from pressed to just_released.
  • Add function release_all that changes state of every touch input from pressed to just_released
  • Add function clear that clears just_pressed, just_released and just_canceled data for every input.
  • Add function reset_all that clears pressed, just_pressed, just_released and just_canceled data for every input.
  • Add tests for functions above.

@matiqo15 matiqo15 added C-Feature A new feature, making something new possible A-Input Player input via keyboard, mouse, gamepad, and more labels Dec 10, 2023
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.

Looks good! I'm annoyed about the incoherent APIs here: ideally we can create a less duplicative abstraction somehow.

@matiqo15 matiqo15 changed the title Add clear_just_pressed in Touches Extend Touches with clear and reset methods Dec 12, 2023
@matiqo15
Copy link
Member Author

@alice-i-cecile I somewhat rebranded this PR. Today I saw that there are similar missing methods that should be added, and thought that they should be in the same PR.

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.

Even better!

@alice-i-cecile alice-i-cecile added this to the 0.13 milestone Dec 12, 2023
@matiqo15
Copy link
Member Author

matiqo15 commented Jan 3, 2024

Rebased because #11128 got merged

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 4, 2024
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 4, 2024
Merged via the queue into bevyengine:main with commit 759b398 Jan 4, 2024
23 checks passed
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-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Touch input clear function
3 participants