Struct TouchPointerEmulator
pub struct TouchPointerEmulator { /* private fields */ }Expand description
Converts direct touch into the toolkit’s ordinary pointer contract.
- One finger: a tap is a left click, a drag scrolls, and a still 500 ms hold is a secondary click (the context menu). Press is deliberately delayed until touch-end: many controls activate on pointer-down, so emitting it earlier would toggle a checkbox before a scroll or edge swipe had enough movement to cancel the tap.
- Two fingers:
TouchGestureArenaarbitrates a pinch (PinchGesture, anchored at the fingers’ centre) from a pan (pixel scroll), so every pinch-aware view zooms on a touchscreen exactly as on a touchpad. - A contact that begins on a widget claiming raw touch
(
Widget::claims_raw_touch) produces no pointer events at all and never cancels, or is cancelled by, another finger; that widget handles itsWindowEvent::Touchstream itself.
Implementations§
§impl TouchPointerEmulator
impl TouchPointerEmulator
pub const LONG_PRESS: Duration
pub fn events(
&mut self,
touch: &Touch,
claims_raw: impl FnOnce(PhysicalPosition<f64>) -> bool,
) -> Vec<TouchPointerEvent>
pub fn events( &mut self, touch: &Touch, claims_raw: impl FnOnce(PhysicalPosition<f64>) -> bool, ) -> Vec<TouchPointerEvent>
Translate one contact update. claims_raw is asked only when a
contact begins, with its physical position.
pub fn long_press_deadline(&self) -> Option<Instant>
pub fn long_press_deadline(&self) -> Option<Instant>
When a still single-finger hold becomes a long press, if one is armed.
Trait Implementations§
§impl Default for TouchPointerEmulator
impl Default for TouchPointerEmulator
§fn default() -> TouchPointerEmulator
fn default() -> TouchPointerEmulator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TouchPointerEmulator
impl RefUnwindSafe for TouchPointerEmulator
impl Send for TouchPointerEmulator
impl Sync for TouchPointerEmulator
impl Unpin for TouchPointerEmulator
impl UnsafeUnpin for TouchPointerEmulator
impl UnwindSafe for TouchPointerEmulator
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.