Enum i_slint_core::input::MouseEvent
source · #[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: f32,
delta_y: f32,
},
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
Fields
position: LogicalPointThe position of the pointer has changed
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 moresource§impl Debug for MouseEvent
impl Debug for MouseEvent
source§impl PartialEq<MouseEvent> for MouseEvent
impl PartialEq<MouseEvent> for MouseEvent
source§fn eq(&self, other: &MouseEvent) -> bool
fn eq(&self, other: &MouseEvent) -> bool
self and other values to be equal, and is used
by ==.