pub type InputEvent = Event;Expand description
Alias used by platform backends for standard events.
Aliased Type§
pub enum InputEvent {
Show 16 variants
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,
},
DragStart {
x: i32,
y: i32,
origin_x: i32,
origin_y: i32,
},
DragMove {
x: i32,
y: i32,
},
DragEnd {
x: i32,
y: i32,
},
KeyDown {
key: Key,
},
KeyUp {
key: Key,
},
Encoder {
diff: i32,
},
LongPress {
x: i32,
y: i32,
},
LongPressRepeat {
x: i32,
y: i32,
},
}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.
DragStart
A drag gesture started: the pointer moved at least the start
threshold away from its press origin. Emitted once per drag by the
DragRecognizer. A contact that starts a drag will not also
produce a PressRelease (click-vs-drag suppression — INPUT-00 §6).
Fields
DragMove
Pointer position update while a drag is in progress. Emitted by
the DragRecognizer for every PointerMove after DragStart.
DragEnd
The dragged pointer lifted; drop position for resolution logic.
Emitted by the DragRecognizer in place of the raw PointerUp.
KeyDown
A keyboard key was pressed.
KeyUp
A keyboard key was released.
Encoder
Rotary encoder rotation since the last read, in detent steps
(positive clockwise). Mirrors lv_indev_data_t::enc_diff. Emitted
by an encoder input device, not by raw hardware (LPAR-04 §5.5).
LongPress
A held contact reached the long-press threshold. Emitted once per
contact by the long-press recognizer (LPAR-04 §9). A pending long
press is disarmed by DragStart.
Fields
LongPressRepeat
A long-pressed contact crossed another repeat interval. Emitted
every repeat period after the initial LongPress by the long-press
recognizer (LPAR-04 §9).