Skip to main content

InputMetrics

Struct InputMetrics 

Source
#[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: u32

Max milliseconds between clicks to register a double-click.

§double_click_distance_px: f32

Max pixels the mouse can move between clicks and still count.

§drag_threshold_px: f32

Pixels the mouse must move while held down before a drag starts.

§caret_blink_rate_ms: u32

Caret blink rate in milliseconds (0 = no blink).

§caret_width_px: f32

Width of the text caret/cursor in pixels (typically 1–2).

§wheel_scroll_lines: u32

Lines to scroll per mouse wheel notch.

§hover_time_ms: u32

Milliseconds to wait before a hover triggers (e.g. tooltip delay). Windows: SystemParametersInfo(SPI_GETMOUSEHOVERTIME) — default 400.

Trait Implementations§

Source§

impl Clone for InputMetrics

Source§

fn clone(&self) -> InputMetrics

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for InputMetrics

Source§

impl Debug for InputMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputMetrics

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for InputMetrics

Source§

fn eq(&self, other: &InputMetrics) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InputMetrics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.