pub enum TouchPhase {
Began,
Moved,
Ended,
Cancelled,
}Expand description
Where a ContactId is in its gesture.
A touchscreen has no “hover”: a contact exists from the moment it lands until
the moment it goes away, so this is the lifecycle rather than a button state
— which is why touch does not reuse ButtonState.
Variants§
Began
The finger landed. The first event any ContactId gets.
Moved
It moved while down.
Ended
The user lifted it. The gesture completed, and a consumer commits whatever it meant — a tap fires, a stick centres, a drag lands where it was let go.
Cancelled
The system took the gesture away: the OS claimed it for an edge swipe, palm rejection changed its mind, the window lost focus, the browser decided the page was scrolling after all.
Not an Ended, and a consumer that treats it as one
fires actions the user did not ask for. The position it carries is the
last one the platform knew, not a place anyone chose, so the answer is to
undo the interaction rather than complete it — the drag goes back, the
tap does not fire, the stick centres without the character having lunged.
What both share is that the contact is over: the id is gone either way,
and a consumer that ignores this one is left holding a finger that will
never move again.