Skip to main content

InteractCx

Struct InteractCx 

Source
pub struct InteractCx<'a, T> { /* private fields */ }
Expand description

input and timing for your interaction

Implementations§

Source§

impl<'a, T: Scalar> InteractCx<'a, T>

Source

pub fn time(&self) -> Duration

the current frame time

Source

pub fn wake_at(&mut self, time: Duration)

request another update at time, even without new input

use this for a long press

Source

pub fn contacts(&mut self) -> Contacts<'_, T> ⓘ

read live mouse presses and touches

includes contacts your widget cannot use. see following a contact to choose and track one.

Source

pub fn hovered(&self) -> bool

Source

pub fn focused(&self) -> bool

Source

pub fn focus(&mut self)

focuses this widget unless a deeper widget took focus during this update

Source

pub fn keyboard(&self) -> Option<KeyboardEvent<'a>>

unclaimed keyboard or text input for this widget

input starts at the focused widget and bubbles through its ancestors. without focus, all mounted handlers are eligible.

Source

pub fn claim_keyboard(&mut self)

stops this keyboard or text event from reaching another interaction

Source

pub fn input(&self) -> &'a Input<T>

this frame’s input regardless of focus or claims

Source

pub fn scroll(&self) -> Option<ScrollEvent>

scrolling over this widget, or the cancellation of a sequence it held

Source

pub fn capture_scroll(&mut self)

keeps a continuous scroll sequence over this widget until it ends

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for InteractCx<'a, T>

§

impl<'a, T> Forget for InteractCx<'a, T>

§

impl<'a, T> Freeze for InteractCx<'a, T>
where NonZero<u32>: Freeze, &'a mut [TrackedContact<T>]: Freeze, &'a mut Option<TrackedScroll>: Freeze, &'a mut Option<Id>: Freeze, &'a mut bool: Freeze, &'a mut Option<Duration>: Freeze, &'a Input<T>: Freeze,

§

impl<'a, T> Move for InteractCx<'a, T>

§

impl<'a, T> RefUnwindSafe for InteractCx<'a, T>

§

impl<'a, T> Send for InteractCx<'a, T>
where T: Send, NonZero<u32>: Send, &'a Input<T>: Send,

§

impl<'a, T> Sync for InteractCx<'a, T>
where T: Sync, NonZero<u32>: Sync, RawVecInner: Sync,

§

impl<'a, T> Unpin for InteractCx<'a, T>
where NonZero<u32>: Unpin, &'a mut [TrackedContact<T>]: Unpin, &'a mut Option<TrackedScroll>: Unpin, &'a mut Option<Id>: Unpin, &'a mut bool: Unpin, &'a mut Option<Duration>: Unpin, &'a Input<T>: Unpin,

§

impl<'a, T> UnsafeUnpin for InteractCx<'a, T>
where NonZeroU32Inner: UnsafeUnpin, &'a mut [TrackedContact<T>]: UnsafeUnpin, &'a mut Option<TrackedScroll>: UnsafeUnpin, &'a mut Option<Id>: UnsafeUnpin, &'a mut bool: UnsafeUnpin, &'a mut Option<Duration>: UnsafeUnpin, &'a Input<T>: UnsafeUnpin,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.