[][src]Enum kas::event::PressSource

pub enum PressSource {
    Mouse(MouseButtonu32),
    Touch(u64),
}

Source of EventChild::Press

Variants

Mouse(MouseButtonu32)

A mouse click

Arguments: button, repeats.

The repeats argument is used for double-clicks and similar. For a single-click, repeats == 1; for a double-click it is 2, for a triple-click it is 3, and so on (without upper limit).

For PressMove and PressEnd events delivered with a mouse-grab, both arguments are copied from the initiating PressStart event. For a PressMove delivered without a grab (only possible with pop-ups) a fake button value is used and repeats == 0.

Touch(u64)

A touch event (with given id)

Implementations

impl PressSource[src]

pub fn is_primary(self) -> bool[src]

Returns true if this represents the left mouse button or a touch event

pub fn is_touch(self) -> bool[src]

Returns true if this represents a touch event

pub fn repetitions(self) -> u32[src]

The repetitions value

This is 1 for a single-click and all touch events, 2 for a double-click, 3 for a triple-click, etc. For PressMove without a grab this is 0.

Trait Implementations

impl Clone for PressSource[src]

impl Copy for PressSource[src]

impl Debug for PressSource[src]

impl Eq for PressSource[src]

impl Hash for PressSource[src]

impl PartialEq<PressSource> for PressSource[src]

impl StructuralEq for PressSource[src]

impl StructuralPartialEq for PressSource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.