pub struct GestureObservation {
pub id: u64,
pub control: usize,
pub kind: GestureKind,
pub phase: Phase,
pub origin: Vec2,
pub position: Vec2,
pub elapsed_seconds: f64,
}Expand description
One accepted event’s observation; never inserted into ActionMap.
Tap and Swipe occur only at End. Drag occurs at each qualifying Move and at
End (including an End that crosses the threshold without an earlier Move).
An End produces at most one observation: Swipe, else latched/qualifying Drag,
else Tap, else none. Start/Cancel never produce an observation. A prior Drag
may finish as Swipe. Consumers must discard drag presentation on Cancel or
explicit clear/layout/profile reset; resets do not synthesize terminal events.
control is the captured layout index, not an InputCode or saved stable slot.
See TouchSurface::handle_timed for an executable example.
Fields§
§id: u64§control: usize§kind: GestureKind§phase: Phase§origin: Vec2Actual touch start, including for nonfloating sticks.
position: Vec2§elapsed_seconds: f64Trait Implementations§
Source§impl Clone for GestureObservation
impl Clone for GestureObservation
Source§fn clone(&self) -> GestureObservation
fn clone(&self) -> GestureObservation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GestureObservation
impl Debug for GestureObservation
Source§impl PartialEq for GestureObservation
impl PartialEq for GestureObservation
impl Copy for GestureObservation
impl StructuralPartialEq for GestureObservation
Auto Trait Implementations§
impl Freeze for GestureObservation
impl RefUnwindSafe for GestureObservation
impl Send for GestureObservation
impl Sync for GestureObservation
impl Unpin for GestureObservation
impl UnwindSafe for GestureObservation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more