pub enum Event {
MouseMove {
pos: Point,
},
MouseDown {
pos: Point,
button: MouseButton,
modifiers: Modifiers,
},
MouseUp {
pos: Point,
button: MouseButton,
modifiers: Modifiers,
},
KeyDown {
key: Key,
modifiers: Modifiers,
},
KeyUp {
key: Key,
modifiers: Modifiers,
},
FocusGained,
FocusLost,
MouseWheel {
pos: Point,
delta_y: f64,
delta_x: f64,
modifiers: Modifiers,
},
}Expand description
A GUI event delivered to a widget.
Coordinate positions are in the local coordinate space of the widget receiving the event (bottom-left origin, Y-up). The framework translates positions as it descends the widget tree.
Variants§
MouseMove
The cursor moved to pos (may be outside widget bounds — used to
clear hover state).
MouseDown
A mouse button was pressed at pos.
MouseUp
A mouse button was released at pos.
KeyDown
A key was pressed while this widget (or a descendant) had focus.
KeyUp
A key was released.
FocusGained
Sent by the framework when this widget gains keyboard focus.
FocusLost
Sent by the framework when this widget loses keyboard focus.
MouseWheel
Mouse wheel scrolled. delta_y is in logical pixels; positive =
scroll up (content moves up, typical “natural” scroll direction).
delta_x is horizontal wheel / trackpad input in the same units;
positive = content moves right. pos is the cursor location at the
time of the scroll.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more