pub enum InputPrimitive {
Rotate {
delta: f64,
},
Press,
Release,
LongPress,
Swipe {
direction: Direction,
},
Slide {
value: f64,
},
Hover {
proximity: f64,
},
Touch {
area: TouchArea,
},
LongTouch {
area: TouchArea,
},
KeyPress {
key: u32,
},
}Expand description
Physical input from a device. Device-agnostic: a Nuimo rotate and a
dial rotate both produce Rotate { delta }.
Variants§
Implementations§
Source§impl InputPrimitive
impl InputPrimitive
Sourcepub fn matches_route(&self, route_input: &str) -> bool
pub fn matches_route(&self, route_input: &str) -> bool
Match this primitive against a wire-format route input string (e.g. “rotate”, “press”, “swipe_right”, “touch_top”).
Sourcepub fn continuous_value(&self) -> Option<f64>
pub fn continuous_value(&self) -> Option<f64>
Extract the continuous value for a rotate/slide, if applicable.
Trait Implementations§
Source§impl Clone for InputPrimitive
impl Clone for InputPrimitive
Source§fn clone(&self) -> InputPrimitive
fn clone(&self) -> InputPrimitive
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 InputPrimitive
impl Debug for InputPrimitive
Source§impl<'de> Deserialize<'de> for InputPrimitive
impl<'de> Deserialize<'de> for InputPrimitive
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InputPrimitive
impl PartialEq for InputPrimitive
Source§impl Serialize for InputPrimitive
impl Serialize for InputPrimitive
impl StructuralPartialEq for InputPrimitive
Auto Trait Implementations§
impl Freeze for InputPrimitive
impl RefUnwindSafe for InputPrimitive
impl Send for InputPrimitive
impl Sync for InputPrimitive
impl Unpin for InputPrimitive
impl UnsafeUnpin for InputPrimitive
impl UnwindSafe for InputPrimitive
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