Enum lvgl::Event

source ·
pub enum Event<T> {
    Pressed,
    Pressing,
    PressLost,
    ShortClicked,
    Clicked,
    LongPressed,
    LongPressedRepeat,
    Released,
    Pointer(PointerEvent),
    Special(T),
}
Expand description

Events are triggered in LVGL when something happens which might be interesting to the user, e.g. if an object:

  • is clicked
  • is dragged
  • its value has changed, etc.

All objects (such as Buttons/Labels/Sliders etc.) receive these generic events regardless of their type.

Variants§

§

Pressed

The object has been pressed

§

Pressing

The object is being pressed (sent continuously while pressing)

§

PressLost

The input device is still being pressed but is no longer on the object

§

ShortClicked

Released before long_press_time config time. Not called if dragged.

§

Clicked

Called on release if not dragged (regardless to long press)

§

LongPressed

Pressing for long_press_time config time. Not called if dragged.

§

LongPressedRepeat

Called after long_press_time config in every long_press_rep_time ms. Not called if dragged.

§

Released

Called in every case when the object has been released even if it was dragged. Not called if slid from the object while pressing and released outside of the object. In this case, Event<_>::PressLost is sent.

§

Pointer(PointerEvent)

Pointer-like input devices events (E.g. mouse or touchpad)

§

Special(T)

Special event for the object type

Trait Implementations§

source§

impl<T: Clone> Clone for Event<T>

source§

fn clone(&self) -> Event<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Event<T>

source§

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

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

impl<S> From<Event<S>> for lv_event_code_t

source§

fn from(event: Event<S>) -> Self

Converts to this type from the input type.
source§

impl<T: Ord> Ord for Event<T>

source§

fn cmp(&self, other: &Event<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq> PartialEq<Event<T>> for Event<T>

source§

fn eq(&self, other: &Event<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd> PartialOrd<Event<T>> for Event<T>

source§

fn partial_cmp(&self, other: &Event<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S> TryFrom<u32> for Event<S>

§

type Error = ()

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

fn try_from(value: lv_event_code_t) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T: Copy> Copy for Event<T>

source§

impl<T: Eq> Eq for Event<T>

source§

impl<T> StructuralEq for Event<T>

source§

impl<T> StructuralPartialEq for Event<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Event<T>where T: RefUnwindSafe,

§

impl<T> Send for Event<T>where T: Send,

§

impl<T> Sync for Event<T>where T: Sync,

§

impl<T> Unpin for Event<T>where T: Unpin,

§

impl<T> UnwindSafe for Event<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere 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) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere 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 Dstwhere Src: CheckedCast<Dst>,

source§

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

Casts the value.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Dstwhere 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) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

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

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · 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) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere 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) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

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

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.