Enum i_slint_core::input::MouseEvent
source · #[repr(C)]
pub enum MouseEvent {
Pressed {
position: LogicalPoint,
button: PointerEventButton,
},
Released {
position: LogicalPoint,
button: PointerEventButton,
},
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
Released
The mouse or finger was released
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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more