pub enum InputEvent {
Show 14 variants
PointerMove {
x: f32,
y: f32,
},
PointerDown,
PointerUp,
RightDown,
RightUp,
FileDrop(PathBuf),
Wheel {
dx: f32,
dy: f32,
},
Modifiers {
shift: bool,
ctrl: bool,
alt: bool,
meta: bool,
},
PointerLeave,
Tab,
ShiftTab,
Key(KeyInput),
Text(String),
ImePreedit {
text: String,
cursor: Option<(usize, usize)>,
},
}Expand description
A logical input event, shared by the windowed runner and headless
SyntheticEvent injection.
Variants§
PointerMove
Pointer moved to logical coordinates.
PointerDown
Primary button pressed.
PointerUp
Primary button released.
RightDown
Secondary (right) button pressed: the context-menu gesture.
RightUp
Secondary (right) button released.
FileDrop(PathBuf)
An OS file was dropped onto the window (one event per file).
Wheel
Wheel / trackpad scroll. Winit convention: positive dy moves the
content down (scrolling toward the top of the document); positive dx
moves the content right.
Fields
Modifiers
Modifier keys changed (runners forward this so pointer gestures can honor Shift — e.g. shift-click selection extension).
Fields
PointerLeave
The pointer left the surface: hover state clears.
Tab
Focus next.
ShiftTab
Focus previous.
Key(KeyInput)
A key press.
Text(String)
Committed text input (typing or IME commit).
ImePreedit
IME preedit update (composition in progress).
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InputEvent
impl Debug for InputEvent
Source§impl From<&SyntheticEvent> for InputEvent
impl From<&SyntheticEvent> for InputEvent
Source§fn from(ev: &SyntheticEvent) -> InputEvent
fn from(ev: &SyntheticEvent) -> InputEvent
Source§impl PartialEq for InputEvent
impl PartialEq for InputEvent
Source§fn eq(&self, other: &InputEvent) -> bool
fn eq(&self, other: &InputEvent) -> bool
self and other values to be equal, and is used by ==.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.