pub enum InputEvent {
MouseMove {
pointer_id: u64,
x: f32,
y: f32,
},
MouseDown {
pointer_id: u64,
x: f32,
y: f32,
button: MouseButton,
},
MouseUp {
pointer_id: u64,
x: f32,
y: f32,
button: MouseButton,
},
MouseDoubleClick {
x: f32,
y: f32,
},
Scroll {
x: f32,
y: f32,
dy: f32,
},
MouseLeave,
}Expand description
Platform-agnostic input event consumed by dispatch.
Cursor coordinates are in logical pixels, matching what widgets draw at.
pointer_id distinguishes simultaneous pointers (multi-touch).
Mouse-driven flows always pass SINGLE_POINTER (= 0); iOS touch
dispatch uses the UITouch* cast to u64 so each finger gets a
stable identifier across Down → Move → Up.
Variants§
MouseMove
MouseDown
MouseUp
MouseDoubleClick
Synthesized when the host detects a second click within the
platform-specific threshold. dispatch uses this to reset params
to their defaults.
Scroll
Vertical wheel scroll. dy > 0 = scroll up (away from user),
dy < 0 = scroll down. Magnitude is in pixels.
MouseLeave
The cursor left the editor surface. Dispatch clears hover state.
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
impl Copy 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