-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add Interaction::Released
(Detect the release of a UIButton)
#7240
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
Conversation
@@ -37,6 +37,8 @@ use smallvec::SmallVec; | |||
pub enum Interaction { | |||
/// The node has been clicked | |||
Clicked, | |||
/// The node has been released from |
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.
/// The node has been released from | |
/// The node has just been released |
That's pretty unfortunate. We could add another system at the end of the frame to reset them? Or run for two frames on interaction in |
When does input reset their "just_pressed" / "just_released" states? Is it within the same frame but at the end of the update stage? |
Interaction::Released
(Detect the release of a UIButton)
Near the start of each frame in |
This is relatively complex, and we haven't reached consensus on the design. Removing from the 0.10 milestone. |
I thought I wanted |
Objective
Fix #5769
Solution
Change to
Interaction::Released
instead ofInteraction::None
for 1 frame as the button is released.Changelog
Added
Interaction
now be consideredInteraction::Released
for 1 frame when the user has released interaction on the button.Feedback Wanted / Unresolved Questions
This solution relies on the ui_focus system running for 1 more frame after the interaction has been released, meaning that it does not work currently work when using the "DesktopMode" winit setting that only runs systems when user-input has occurred. It will be stuck in "Released" state until some new input is provided by the user.
Any ideas as to how that can be solved?