pub struct InputOptions {
pub line_scroll_speed: f32,
pub scroll_zoom_speed: f32,
pub max_click_dist: f32,
pub max_click_duration: f64,
pub max_double_click_delay: f64,
pub zoom_modifier: Modifiers,
pub horizontal_scroll_modifier: Modifiers,
pub vertical_scroll_modifier: Modifiers,
}Expand description
Options for input state handling.
Fields§
§line_scroll_speed: f32Multiplier for the scroll speed when reported in crate::MouseWheelUnit::Lines.
scroll_zoom_speed: f32Controls the speed at which we zoom in when doing ctrl/cmd + scroll.
max_click_dist: f32After a pointer-down event, if the pointer moves more than this, it won’t become a click.
max_click_duration: f64If the pointer is down for longer than this it will no longer register as a click.
If a touch is held for this many seconds while still, then it will register as a “long-touch” which is equivalent to a secondary click.
This is to support “press and hold for context menu” on touch screens.
max_double_click_delay: f64The new pointer press must come within this many seconds from previous pointer release for double click (or when this value is doubled, triple click) to count.
zoom_modifier: ModifiersWhen this modifier is down, all scroll events are treated as zoom events.
The default is CTRL/CMD, and it is STRONGLY recommended to NOT change this.
horizontal_scroll_modifier: ModifiersWhen this modifier is down, all scroll events are treated as horizontal scrolls,
and when combined with Self::zoom_modifier it will result in zooming
on only the horizontal axis.
The default is SHIFT, and it is STRONGLY recommended to NOT change this.
vertical_scroll_modifier: ModifiersWhen this modifier is down, all scroll events are treated as vertical scrolls,
and when combined with Self::zoom_modifier it will result in zooming
on only the vertical axis.
Implementations§
Trait Implementations§
Source§impl Clone for InputOptions
impl Clone for InputOptions
Source§fn clone(&self) -> InputOptions
fn clone(&self) -> InputOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InputOptions
impl Debug for InputOptions
Source§impl Default for InputOptions
impl Default for InputOptions
Source§impl<'de> Deserialize<'de> for InputOptions
impl<'de> Deserialize<'de> for InputOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for InputOptions
impl PartialEq for InputOptions
Source§impl Serialize for InputOptions
impl Serialize for InputOptions
impl Copy for InputOptions
impl StructuralPartialEq for InputOptions
Auto Trait Implementations§
impl Freeze for InputOptions
impl RefUnwindSafe for InputOptions
impl Send for InputOptions
impl Sync for InputOptions
impl Unpin for InputOptions
impl UnwindSafe for InputOptions
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