#[repr(C)]pub enum MouseEvent {
Pressed {
position: LogicalPoint,
button: PointerEventButton,
click_count: u8,
},
Released {
position: LogicalPoint,
button: PointerEventButton,
click_count: u8,
},
Moved {
position: LogicalPoint,
},
Wheel {
position: LogicalPoint,
delta_x: Coord,
delta_y: Coord,
},
Exit,
}
Expand description
A mouse or touch event
The only difference with crate::platform::WindowEvent
us that it uses untyped Point
TODO: merge with platform::WindowEvent
Variants§
Pressed
The mouse or finger was pressed
position
is the position of the mouse when the event happens.
button
describes the button that is pressed when the event happens.
click_count
represents the current number of clicks.
Released
The mouse or finger was released
position
is the position of the mouse when the event happens.
button
describes the button that is pressed when the event happens.
click_count
represents the current number of clicks.
Moved
The position of the pointer has changed
Fields
position: LogicalPoint
Wheel
Wheel was operated.
pos
is the position of the mouse when the event happens.
delta_x
is the amount of pixels to scroll in horizontal direction,
delta_y
is the amount of pixels to scroll in vertical direction.
Exit
The mouse exited the item or component
Implementations§
Source§impl MouseEvent
impl MouseEvent
Sourcepub fn position(&self) -> Option<LogicalPoint>
pub fn position(&self) -> Option<LogicalPoint>
The position of the cursor for this event, if any
Sourcepub fn translate(&mut self, vec: LogicalVector)
pub fn translate(&mut self, vec: LogicalVector)
Translate the position by the given value
Trait Implementations§
Source§impl Clone for MouseEvent
impl Clone for MouseEvent
Source§fn clone(&self) -> MouseEvent
fn clone(&self) -> MouseEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more