#[repr(C)]pub struct InputMetrics {
pub double_click_time_ms: u32,
pub double_click_distance_px: f32,
pub drag_threshold_px: f32,
pub caret_blink_rate_ms: u32,
pub caret_width_px: f32,
pub wheel_scroll_lines: u32,
pub hover_time_ms: u32,
}Expand description
Input interaction timing and distance thresholds from the OS.
These values are queried from the operating system to match the user’s configured double-click speed, drag sensitivity, caret blink rate, etc.
§Platform APIs
- macOS:
NSEvent.doubleClickInterval - Windows:
GetDoubleClickTime(),GetSystemMetrics(SM_CXDOUBLECLK),GetCaretBlinkTime(),SystemParametersInfo(SPI_GETWHEELSCROLLLINES) - Linux: XDG Desktop Portal / gsettings
Fields§
§double_click_time_ms: u32Max milliseconds between clicks to register a double-click.
double_click_distance_px: f32Max pixels the mouse can move between clicks and still count.
drag_threshold_px: f32Pixels the mouse must move while held down before a drag starts.
caret_blink_rate_ms: u32Caret blink rate in milliseconds (0 = no blink).
caret_width_px: f32Width of the text caret/cursor in pixels (typically 1–2).
wheel_scroll_lines: u32Lines to scroll per mouse wheel notch.
hover_time_ms: u32Milliseconds to wait before a hover triggers (e.g. tooltip delay).
Windows: SystemParametersInfo(SPI_GETMOUSEHOVERTIME) — default 400.
Trait Implementations§
Source§impl Clone for InputMetrics
impl Clone for InputMetrics
Source§fn clone(&self) -> InputMetrics
fn clone(&self) -> InputMetrics
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 InputMetrics
impl Debug for InputMetrics
Source§impl Default for InputMetrics
impl Default for InputMetrics
Source§impl PartialEq for InputMetrics
impl PartialEq for InputMetrics
impl Copy for InputMetrics
impl StructuralPartialEq for InputMetrics
Auto Trait Implementations§
impl Freeze for InputMetrics
impl RefUnwindSafe for InputMetrics
impl Send for InputMetrics
impl Sync for InputMetrics
impl Unpin for InputMetrics
impl UnsafeUnpin for InputMetrics
impl UnwindSafe for InputMetrics
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