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: 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 moresource§impl Debug for MouseEvent
impl Debug for MouseEvent
source§impl PartialEq for MouseEvent
impl PartialEq for MouseEvent
impl Copy for MouseEvent
impl StructuralPartialEq for MouseEvent
Auto Trait Implementations§
impl Freeze for MouseEvent
impl RefUnwindSafe for MouseEvent
impl Send for MouseEvent
impl Sync for MouseEvent
impl Unpin for MouseEvent
impl UnwindSafe for MouseEvent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)