Skip to main content

PointerEventKind

Enum PointerEventKind 

Source
pub enum PointerEventKind {
    Down,
    Move,
    Up,
    ButtonDown(PointerButton),
    ButtonUp(PointerButton),
    Cancel,
    Scroll,
    Zoom,
    RotaryScrollPre,
    RotaryScroll,
    Enter,
    Exit,
}
Expand description

What a pointer event reports.

Variants§

§

Down

A pointer went down: the primary mouse button, a finger or a pen touched. Other mouse buttons arrive as ButtonDown.

§

Move

A pointer moved.

§

Up

A pointer went up: the primary mouse button, a finger or a pen lifted.

§

ButtonDown(PointerButton)

A mouse button other than the primary one went down: the right, the middle or a side button. A click, a drag or a scroll starts only from Down; a handler that takes another button, such as one that opens a menu or turns a camera, matches this. The nodes under the pointer receive it, or, while another button is down, the nodes that took that button’s press. Those nodes receive the moves until the last button goes up, with the buttons held in PointerEvent::buttons.

§

ButtonUp(PointerButton)

A mouse button other than the primary one went up; see ButtonDown.

§

Cancel

The system canceled the gesture of the pointer.

§

Scroll

A wheel or trackpad scroll. The delta is in PointerEvent::scroll_delta.

§

Zoom

Discrete zoom step (desktop ctrl+wheel, browser pinch-trackpad). The multiplicative factor is carried in PointerEvent::zoom_delta.

§

RotaryScrollPre

Rotary scroll (Wear OS crown / rotating bezel) during the capture pass, which runs root-to-focused so ancestors can intercept the event before the focused node sees it.

The scroll amounts are carried in PointerEvent::scroll_delta (y = vertical pixels, x = horizontal pixels) and the rotary uptime in PointerEvent::time_ms; use PointerEvent::rotary_scroll_event to read them back as a RotaryScrollEvent. Mirrors Compose’s onPreRotaryScrollEvent.

§

RotaryScroll

Rotary scroll during the bubble pass, which runs focused-to-root. Mirrors Compose’s onRotaryScrollEvent.

§

Enter

A pointer began to hover over the receiving node.

§

Exit

A pointer stopped hovering over the receiving node.

Implementations§

Source§

impl PointerEventKind

Source

pub fn is_rotary(self) -> bool

Returns true for the two rotary passes.

Trait Implementations§

Source§

impl Clone for PointerEventKind

Source§

fn clone(&self) -> PointerEventKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PointerEventKind

Source§

impl Debug for PointerEventKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for PointerEventKind

Source§

impl PartialEq for PointerEventKind

Source§

fn eq(&self, other: &PointerEventKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PointerEventKind

Auto Trait Implementations§

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> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> LayoutData for T
where T: Any + Debug + PartialEq,

Source§

fn same_as(&self, other: &(dyn LayoutData + 'static)) -> bool

Whether other holds the same data, so a parent can keep its last measure.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

The data as Any, to read it by its type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.