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,
},
}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.