#[non_exhaustive]pub enum ObjectEvent {
Show 20 variants
Pressed {
x: i32,
y: i32,
},
Released {
x: i32,
y: i32,
},
Clicked {
x: i32,
y: i32,
},
DoubleClicked {
x: i32,
y: i32,
},
LongPressed {
x: i32,
y: i32,
},
LongPressedRepeat {
x: i32,
y: i32,
},
Key(Key),
Rotary {
diff: i32,
},
Focused,
Defocused,
Gesture(GestureDir),
Attached,
Detached,
ChildChanged,
ScrollBegin,
Scroll {
scroll_x: i32,
scroll_y: i32,
},
ScrollEnd,
ScrollThrow {
vel_x: i32,
vel_y: i32,
},
SizeChanged,
LayoutChanged,
}Expand description
Object-semantic event vocabulary for the LPAR-04 dispatch model.
This is the object-level event type, distinct from the device/recognizer
stream vocabulary in crate::event::Event. Stream events flow through
pipelines and legacy dispatch; ObjectEvent codes are delivered only
through dispatch_object_event.
This enum is #[non_exhaustive]: consumers must include a wildcard
arm. New codes will be added in later LPAR phases under the Specification
Required policy.
§LVGL analogue table (LPAR-04 §5.3 + LPAR-05 §6)
| Variant | Trigger | LVGL analogue |
|---|---|---|
Pressed | Stream PressDown at target | LV_EVENT_PRESSED |
Released | Contact ended over target | LV_EVENT_RELEASED |
Clicked | Stream PressRelease at target | LV_EVENT_CLICKED |
DoubleClicked | Stream DoubleTap at target | LV_EVENT_DOUBLE_CLICKED |
LongPressed | Long-press recognizer output at target | LV_EVENT_LONG_PRESSED |
LongPressedRepeat | Long-press repeat output | LV_EVENT_LONG_PRESSED_REPEAT |
Key | Key delivery to focused object | LV_EVENT_KEY |
Rotary | Encoder diff in editing mode | LV_EVENT_ROTARY |
Focused | Object gained focus | LV_EVENT_FOCUSED |
Defocused | Object lost focus | LV_EVENT_DEFOCUSED |
Gesture | Directional swipe summary | LV_EVENT_GESTURE |
Attached | Subtree root attached via append_child/insert_child | LV_EVENT_CHILD_CREATED (inverted) |
Detached | Subtree root detached via detach_child | LV_EVENT_DELETE (narrowed) |
ChildChanged | Parent notified after child add/remove/reorder | LV_EVENT_CHILD_CHANGED |
ScrollBegin | Scroll session began on this container | LV_EVENT_SCROLL_BEGIN |
Scroll | Scroll offset changed | LV_EVENT_SCROLL |
ScrollEnd | Scroll session ended and offset settled | LV_EVENT_SCROLL_END |
ScrollThrow | Throw/momentum phase initiated | LV_EVENT_SCROLL_THROW_BEGIN |
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pressed
A stable contact began at the given coordinates.
Derived from stream Event::PressDown resolved at this target.
Use for visual press feedback (e.g. button highlight).
Released
A contact ended over this object (any cause).
Always paired with a preceding Pressed.
Clicked
A short clean tap was completed on this object.
Derived from stream Event::PressRelease. Contacts that crossed
the drag threshold produce no Clicked (INPUT-00 §6 click-vs-drag
suppression).
DoubleClicked
Two consecutive short taps were detected on this object.
Derived from stream Event::DoubleTap.
LongPressed
A held contact reached the long-press threshold.
Emitted once per contact by the long-press recognizer (LPAR-04 §9).
Disarmed by DragStart before emission.
Fields
LongPressedRepeat
A long-pressed contact crossed another repeat interval.
Emitted every repeat period after the initial LongPressed.
Fields
Key(Key)
A key event was delivered to this focused object.
Delivered when this object has focus and a keypad/encoder key event
is received. In navigate mode, encoder presses map to
Key::Enter; in editing mode, all keys route here.
Rotary
Encoder rotation delta delivered to this focused object in editing mode.
In navigate mode, rotation drives focus_next/focus_prev instead.
Focused
This object gained keyboard focus.
The ObjectStates::FOCUSED bit is set before this event is emitted.
Defocused
This object lost keyboard focus.
The ObjectStates::FOCUSED bit is cleared before this event is emitted.
Gesture(GestureDir)
A directional swipe was recognized over this object.
Derived from drag displacement (LPAR-04 §9.6). Scroll semantics are LPAR-05 non-goals.
Tuple Fields
0: GestureDirDirection of the swipe.
Attached
This node was attached to a live tree via
append_child or
insert_child.
Delivered synchronously to the attached subtree root after the structural change.
Detached
This node was detached from its parent via
detach_child.
Delivered synchronously to the detached subtree root after the structural change. This is the lifecycle event name reserved by LPAR-02 §6.10.
ChildChanged
A child was added to or removed from this node.
Delivered synchronously to the parent after
append_child,
insert_child, or
detach_child.
ScrollBegin
Scroll session began on this container.
Emitted once per scroll session when a drag gesture transitions the
container into active scrolling. The offset is unchanged at this point;
the first Scroll event carries the new offset.
LVGL analogue: LV_EVENT_SCROLL_BEGIN.
Scroll
Scroll offset changed.
Emitted each tick/frame that the offset advances — during active drag scrolling and during throw deceleration. The payload carries the new logical scroll offset after the change.
LVGL analogue: LV_EVENT_SCROLL.
Fields
ScrollEnd
Scroll session ended and the offset has settled.
Emitted once per scroll session, after the final Scroll
event (after throw deceleration or snap settle completes, or after a
drag ended with zero residual velocity).
LVGL analogue: LV_EVENT_SCROLL_END.
ScrollThrow
Throw/momentum phase initiated.
Emitted once when the finger lifted with enough residual velocity to
initiate throw/momentum. Emitted between the last drag-driven
Scroll and the first momentum-driven
Scroll.
LVGL analogue: LV_EVENT_SCROLL_THROW_BEGIN.
Fields
SizeChanged
This node’s effective bounds changed as a result of a layout pass.
Delivered to the node whose computed rect was updated. Does not bubble by default. Widgets that maintain internal layout caches (e.g. a label that wraps text at its container width) SHOULD listen for this and invalidate their caches.
LVGL analogue: LV_EVENT_SIZE_CHANGED.
LayoutChanged
All children of this layout container have been re-placed.
Delivered to the container node after run_layout
completes placing all children for this container. Does not bubble
by default.
LVGL analogue: LV_EVENT_LAYOUT_CHANGED.
Trait Implementations§
Source§impl Clone for ObjectEvent
impl Clone for ObjectEvent
Source§fn clone(&self) -> ObjectEvent
fn clone(&self) -> ObjectEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more