Enum i_slint_core::api::WindowEvent
source · [−]#[non_exhaustive]
pub enum WindowEvent {
PointerPressed {
position: LogicalPosition,
button: PointerEventButton,
},
PointerReleased {
position: LogicalPosition,
button: PointerEventButton,
},
PointerMoved {
position: LogicalPosition,
},
PointerScrolled {
position: LogicalPosition,
delta_x: f32,
delta_y: f32,
},
PointerExited,
}Expand description
A event that describes user input.
Slint backends typically receive events from the windowing system, translate them to this
enum and deliver to the scene of items via Window::dispatch_event().
The pointer variants describe events originating from an input device such as a mouse or a contact point on a touch-enabled surface.
All position fields are in logical window coordinates.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
PointerPressed
A pointer was pressed.
PointerReleased
A pointer was released.
PointerMoved
Fields
position: LogicalPositionThe position of the pointer has changed.
PointerScrolled
Fields
position: LogicalPositiondelta_x: f32The amount of logical pixels to scroll in the horizontal direction.
delta_y: f32The amount of logical pixels to scroll in the vertical direction.
The wheel button of a mouse was rotated to initiate scrolling.
PointerExited
The pointer exited the window.
Implementations
sourceimpl WindowEvent
impl WindowEvent
sourcepub fn position(&self) -> Option<LogicalPosition>
pub fn position(&self) -> Option<LogicalPosition>
The position of the cursor for this event, if any
Trait Implementations
sourceimpl Clone for WindowEvent
impl Clone for WindowEvent
sourcefn clone(&self) -> WindowEvent
fn clone(&self) -> WindowEvent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for WindowEvent
impl Debug for WindowEvent
sourceimpl From<WindowEvent> for MouseEvent
impl From<WindowEvent> for MouseEvent
sourcefn from(event: WindowEvent) -> Self
fn from(event: WindowEvent) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<WindowEvent> for WindowEvent
impl PartialEq<WindowEvent> for WindowEvent
sourcefn eq(&self, other: &WindowEvent) -> bool
fn eq(&self, other: &WindowEvent) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Copy for WindowEvent
impl StructuralPartialEq for WindowEvent
Auto Trait Implementations
impl RefUnwindSafe for WindowEvent
impl Send for WindowEvent
impl Sync for WindowEvent
impl Unpin for WindowEvent
impl UnwindSafe for WindowEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more