Skip to main content

ObjectEvent

Enum ObjectEvent 

Source
#[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)

VariantTriggerLVGL analogue
PressedStream PressDown at targetLV_EVENT_PRESSED
ReleasedContact ended over targetLV_EVENT_RELEASED
ClickedStream PressRelease at targetLV_EVENT_CLICKED
DoubleClickedStream DoubleTap at targetLV_EVENT_DOUBLE_CLICKED
LongPressedLong-press recognizer output at targetLV_EVENT_LONG_PRESSED
LongPressedRepeatLong-press repeat outputLV_EVENT_LONG_PRESSED_REPEAT
KeyKey delivery to focused objectLV_EVENT_KEY
RotaryEncoder diff in editing modeLV_EVENT_ROTARY
FocusedObject gained focusLV_EVENT_FOCUSED
DefocusedObject lost focusLV_EVENT_DEFOCUSED
GestureDirectional swipe summaryLV_EVENT_GESTURE
AttachedSubtree root attached via append_child/insert_childLV_EVENT_CHILD_CREATED (inverted)
DetachedSubtree root detached via detach_childLV_EVENT_DELETE (narrowed)
ChildChangedParent notified after child add/remove/reorderLV_EVENT_CHILD_CHANGED
ScrollBeginScroll session began on this containerLV_EVENT_SCROLL_BEGIN
ScrollScroll offset changedLV_EVENT_SCROLL
ScrollEndScroll session ended and offset settledLV_EVENT_SCROLL_END
ScrollThrowThrow/momentum phase initiatedLV_EVENT_SCROLL_THROW_BEGIN

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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).

Fields

§x: i32

Horizontal coordinate of the contact.

§y: i32

Vertical coordinate of the contact.

§

Released

A contact ended over this object (any cause).

Always paired with a preceding Pressed.

Fields

§x: i32

Horizontal coordinate at release.

§y: i32

Vertical coordinate at release.

§

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).

Fields

§x: i32

Horizontal coordinate of the tap.

§y: i32

Vertical coordinate of the tap.

§

DoubleClicked

Two consecutive short taps were detected on this object.

Derived from stream Event::DoubleTap.

Fields

§x: i32

Horizontal coordinate of the second tap.

§y: i32

Vertical coordinate of the second tap.

§

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

§x: i32

Horizontal coordinate of the held contact.

§y: i32

Vertical coordinate of the held contact.

§

LongPressedRepeat

A long-pressed contact crossed another repeat interval.

Emitted every repeat period after the initial LongPressed.

Fields

§x: i32

Horizontal coordinate of the held contact.

§y: i32

Vertical coordinate of the held contact.

§

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.

Tuple Fields

§0: Key

The key that was pressed or repeated.

§

Rotary

Encoder rotation delta delivered to this focused object in editing mode.

In navigate mode, rotation drives focus_next/focus_prev instead.

Fields

§diff: i32

Net rotation steps (positive = clockwise).

§

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: GestureDir

Direction 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

§scroll_x: i32

New horizontal scroll offset in logical pixels.

§scroll_y: i32

New vertical scroll offset in logical pixels.

§

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

§vel_x: i32

Estimated horizontal throw velocity in logical pixels per tick.

§vel_y: i32

Estimated throw velocity in logical pixels per tick.

§

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

Source§

fn clone(&self) -> ObjectEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObjectEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ObjectEvent

Source§

impl PartialEq for ObjectEvent

Source§

fn eq(&self, other: &ObjectEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ObjectEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.