Struct maia_wasm::pointer::PointerTracker
source · pub struct PointerTracker { /* private fields */ }Expand description
Pointer tracker.
A pointer tracker receives PointerEvent’s from the web browser, maintains
state information about the pointers that are active, and generates
PointerGesture’s.
Implementations§
source§impl PointerTracker
impl PointerTracker
sourcepub fn new() -> PointerTracker
pub fn new() -> PointerTracker
Creates a new pointer tracker.
sourcepub fn on_pointer_down(&mut self, event: PointerEvent)
pub fn on_pointer_down(&mut self, event: PointerEvent)
Handler for the pointer down event.
This function should be used as the handler for pointer down events.
sourcepub fn on_pointer_up(&mut self, event: PointerEvent)
pub fn on_pointer_up(&mut self, event: PointerEvent)
Handler for the pointer up event.
This function should be used as the handler for pointer up events.
sourcepub fn on_pointer_move(&mut self, event: PointerEvent) -> Option<PointerGesture>
pub fn on_pointer_move(&mut self, event: PointerEvent) -> Option<PointerGesture>
Handler for the pointer move event.
This functions should be used as the hanlder for pointer move events.
If the event produces a corresponding pointer gesture, it is returned.
sourcepub fn has_active_pointers(&self) -> bool
pub fn has_active_pointers(&self) -> bool
Checks if there are any active pointers.
This function returns true if there are any active pointers
currently. An active pointer is one for which a pointer down event has
been received, and the corresponding pointer up event has not been
received yet.