pub struct HoverManager { /* private fields */ }Expand description
Manages hover state history for all input points
Records hit test results for mouse and touch inputs over multiple frames:
- DragStart detection (requires movement threshold over multiple frames)
- Hover-over event detection
- Multi-touch gesture detection
- Input path analysis
The manager maintains a separate history for each active input point.
Implementations§
Source§impl HoverManager
impl HoverManager
Sourcepub fn push_hit_test(&mut self, input_id: InputPointId, hit_test: FullHitTest)
pub fn push_hit_test(&mut self, input_id: InputPointId, hit_test: FullHitTest)
Push a new hit test result for a specific input point
The most recent result is always at index 0 for that input point. If the history is full, the oldest frame is dropped.
Sourcepub fn remove_input_point(&mut self, input_id: &InputPointId)
pub fn remove_input_point(&mut self, input_id: &InputPointId)
Remove an input point’s history (e.g., when touch ends)
Sourcepub fn get_current(&self, input_id: &InputPointId) -> Option<&FullHitTest>
pub fn get_current(&self, input_id: &InputPointId) -> Option<&FullHitTest>
Get the most recent hit test result for an input point
Returns None if no hit tests have been recorded for this input point.
Sourcepub fn get_current_mouse(&self) -> Option<&FullHitTest>
pub fn get_current_mouse(&self) -> Option<&FullHitTest>
Get the most recent mouse cursor hit test (convenience method)
Sourcepub fn get_frame(
&self,
input_id: &InputPointId,
frames_ago: usize,
) -> Option<&FullHitTest>
pub fn get_frame( &self, input_id: &InputPointId, frames_ago: usize, ) -> Option<&FullHitTest>
Get the hit test result from N frames ago for an input point
Returns None if the requested frame is not in history.
Sourcepub fn get_history(
&self,
input_id: &InputPointId,
) -> Option<&VecDeque<FullHitTest>>
pub fn get_history( &self, input_id: &InputPointId, ) -> Option<&VecDeque<FullHitTest>>
Get the entire hover history for an input point (most recent first)
Sourcepub fn get_active_input_points(&self) -> Vec<InputPointId>
pub fn get_active_input_points(&self) -> Vec<InputPointId>
Get all currently tracked input points
Sourcepub fn frame_count(&self, input_id: &InputPointId) -> usize
pub fn frame_count(&self, input_id: &InputPointId) -> usize
Get the number of frames in history for an input point
Sourcepub fn clear_input_point(&mut self, input_id: &InputPointId)
pub fn clear_input_point(&mut self, input_id: &InputPointId)
Clear history for a specific input point
Sourcepub fn has_sufficient_history_for_gestures(
&self,
input_id: &InputPointId,
) -> bool
pub fn has_sufficient_history_for_gestures( &self, input_id: &InputPointId, ) -> bool
Check if we have enough frames for gesture detection on an input point
DragStart detection requires analyzing movement over multiple frames. This returns true if we have at least 2 frames of history.
Sourcepub fn any_has_sufficient_history_for_gestures(&self) -> bool
pub fn any_has_sufficient_history_for_gestures(&self) -> bool
Check if any input point has enough history for gesture detection
Trait Implementations§
Source§impl Clone for HoverManager
impl Clone for HoverManager
Source§fn clone(&self) -> HoverManager
fn clone(&self) -> HoverManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HoverManager
impl Debug for HoverManager
Source§impl Default for HoverManager
impl Default for HoverManager
Source§impl PartialEq for HoverManager
impl PartialEq for HoverManager
impl StructuralPartialEq for HoverManager
Auto Trait Implementations§
impl Freeze for HoverManager
impl RefUnwindSafe for HoverManager
impl Send for HoverManager
impl Sync for HoverManager
impl Unpin for HoverManager
impl UnwindSafe for HoverManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more