pub struct InteractCx<'a, T> { /* private fields */ }Expand description
input and timing for your interaction
Self::contactsfor mouse presses and touchesSelf::scrollfor wheel and trackpad inputSelf::keyboardfor keyboard and text inputSelf::wake_atfor timed gestures
Implementations§
Source§impl<'a, T: Scalar> InteractCx<'a, T>
impl<'a, T: Scalar> InteractCx<'a, T>
Sourcepub fn wake_at(&mut self, time: Duration)
pub fn wake_at(&mut self, time: Duration)
request another update at time, even without new input
use this for a long press
Sourcepub fn contacts(&mut self) -> Contacts<'_, T> ⓘ
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.
pub fn hovered(&self) -> bool
pub fn focused(&self) -> bool
Sourcepub fn focus(&mut self)
pub fn focus(&mut self)
focuses this widget unless a deeper widget took focus during this update
Sourcepub fn keyboard(&self) -> Option<KeyboardEvent<'a>>
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.
Sourcepub fn claim_keyboard(&mut self)
pub fn claim_keyboard(&mut self)
stops this keyboard or text event from reaching another interaction
Sourcepub fn scroll(&self) -> Option<ScrollEvent>
pub fn scroll(&self) -> Option<ScrollEvent>
scrolling over this widget, or the cancellation of a sequence it held
Sourcepub fn capture_scroll(&mut self)
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>
impl<'a, T> Move for InteractCx<'a, T>
impl<'a, T> RefUnwindSafe for InteractCx<'a, T>
impl<'a, T> Send for InteractCx<'a, T>
impl<'a, T> Sync for InteractCx<'a, T>
impl<'a, T> Unpin for InteractCx<'a, T>
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> 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