Enum slint::WindowEvent
[−]#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PointerPressed
A pointer was pressed.
PointerReleased
A pointer was released.
PointerMoved
Fields
position: LogicalPosition
The position of the pointer has changed.
PointerScrolled
Fields
position: LogicalPosition
delta_x: f32
The amount of logical pixels to scroll in the horizontal direction.
delta_y: f32
The 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
impl WindowEvent
impl WindowEvent
pub fn position(&self) -> Option<LogicalPosition>
pub fn position(&self) -> Option<LogicalPosition>
The position of the cursor for this event, if any
Trait Implementations
impl Clone for WindowEvent
impl Clone for WindowEvent
fn 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 moreimpl Debug for WindowEvent
impl Debug for WindowEvent
impl From<WindowEvent> for MouseEvent
impl From<WindowEvent> for MouseEvent
fn from(event: WindowEvent) -> MouseEvent
fn from(event: WindowEvent) -> MouseEvent
Converts to this type from the input type.
impl PartialEq<WindowEvent> for WindowEvent
impl PartialEq<WindowEvent> for WindowEvent
fn eq(&self, other: &WindowEvent) -> bool
fn eq(&self, other: &WindowEvent) -> bool
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