pub type InputEvent = Event;Expand description
Alias used by platform backends for standard events.
Aliased Type§
pub enum InputEvent {
Tick,
PointerDown {
x: i32,
y: i32,
},
PointerUp {
x: i32,
y: i32,
},
PointerMove {
x: i32,
y: i32,
},
Touch {
count: u8,
points: [TouchPoint; 5],
},
PressDown {
x: i32,
y: i32,
},
PressRelease {
x: i32,
y: i32,
},
DoubleTap {
x: i32,
y: i32,
},
KeyDown {
key: Key,
},
KeyUp {
key: Key,
},
}Variants§
Tick
Called periodically to advance animations or timers.
PointerDown
A pointer (mouse or touch) was pressed at the given coordinates.
Fields
PointerUp
The pointer was released.
Fields
PointerMove
The pointer moved while still pressed.
Fields
Touch
Multi-touch frame with per-point data.
Emitted when two or more simultaneous contacts are detected.
Only points[..count] entries are valid.
Fields
points: [TouchPoint; 5]Per-point data. Entries beyond count are meaningless.
PressDown
Stable contact began (debounced). Use for visual press feedback such as button highlighting. Emitted by the gesture recognizer, not by raw hardware input.
PressRelease
Stable contact released (debounced). The primary “click/tap” action
trigger. Widgets should match this instead of PointerUp for
reliable single-fire behavior.
DoubleTap
Two consecutive short taps detected at the given coordinates.
Emitted by the DoubleTapRecognizer when two PressRelease events
with short hold durations occur within the double-tap time window.
KeyDown
A keyboard key was pressed.
KeyUp
A keyboard key was released.