#[non_exhaustive]pub enum InputEvent {
PointerMoved {
position: Point,
},
PointerButton {
button: PointerButton,
state: ElementState,
position: Point,
modifiers: Modifiers,
},
PointerScroll {
delta_x: f32,
delta_y: f32,
position: Point,
},
PointerLeft,
TouchDown {
id: TouchId,
position: Point,
},
TouchMoved {
id: TouchId,
position: Point,
},
TouchUp {
id: TouchId,
position: Point,
cancelled: bool,
},
Key {
code: KeyCode,
state: ElementState,
repeat: bool,
modifiers: Modifiers,
},
Text {
ch: char,
},
SurfaceResized {
size: Size,
scale_factor: f32,
},
CloseRequested,
}Expand description
Something the user or the windowing system did.
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.
PointerMoved
The pointer moved to position.
PointerButton
A pointer button changed state.
PointerScroll
The wheel or a scroll gesture moved. Positive y scrolls content down.
Fields
PointerLeft
The pointer left the surface. Clear hover state.
TouchDown
A finger touched down.
Fields
§
id: TouchIdFinger identity, valid until the matching InputEvent::TouchUp.
TouchMoved
A finger moved while down.
TouchUp
A finger lifted, or its sequence was cancelled.
Fields
Key
A key changed state.
Fields
§
state: ElementStateDown or up.
Text
Committed text, one character at a time.
Emitted after dead-key composition, so pressing ¨ then o yields exactly
one Text('ö') and no text for the dead key itself.
SurfaceResized
The surface changed size or DPI. Invalidate layout and damage history.
Fields
CloseRequested
The user asked to close. The application decides whether to honour it.
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputEvent
impl Debug for InputEvent
Source§impl PartialEq for InputEvent
impl PartialEq for InputEvent
impl StructuralPartialEq for InputEvent
Auto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin for InputEvent
impl UnsafeUnpin for InputEvent
impl UnwindSafe for InputEvent
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
Mutably borrows from an owned value. Read more