Enum kas::event::PressSource [−][src]
pub enum PressSource {
Mouse(MouseButton, u32),
Touch(u64),
}
Expand description
Source of EventChild::Press
Variants
Mouse(MouseButton, u32)
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
.
Tuple Fields of Mouse
0: MouseButton
1: u32
Touch(u64)
A touch event (with given id
)
Tuple Fields of Touch
0: u64
Implementations
Returns true if this represents the left mouse button or a touch event
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for PressSource
impl Send for PressSource
impl Sync for PressSource
impl Unpin for PressSource
impl UnwindSafe for PressSource
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
Compare self to key
and return true
if they are equal.