Struct input_linux::AbsoluteEvent
source · #[repr(C)]pub struct AbsoluteEvent {
pub time: EventTime,
pub axis: AbsoluteAxis,
pub value: i32,
/* private fields */
}
Expand description
Events that occur when the state of an absolute axis is changed.
Fields§
§time: EventTime
The timestamp associated with the event.
axis: AbsoluteAxis
The axis associated with the event.
value: i32
The absolute value of the axis.
Implementations§
source§impl<'a> AbsoluteEvent
impl<'a> AbsoluteEvent
sourcepub const fn new(time: EventTime, axis: AbsoluteAxis, value: i32) -> Self
pub const fn new(time: EventTime, axis: AbsoluteAxis, value: i32) -> Self
Creates a new event from the given code and value.
sourcepub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
pub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
Reinterpret a generic event without checking for validity.
sourcepub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
pub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
Reinterpret a mutable generic event without checking for validity.
sourcepub fn as_event(&self) -> &InputEvent
pub fn as_event(&self) -> &InputEvent
A generic input event reference.
sourcepub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
pub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
A mutable generic input event reference.
Trait Implementations§
source§impl AsRef<InputEvent> for AbsoluteEvent
impl AsRef<InputEvent> for AbsoluteEvent
source§fn as_ref(&self) -> &InputEvent
fn as_ref(&self) -> &InputEvent
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<input_event> for AbsoluteEvent
impl AsRef<input_event> for AbsoluteEvent
source§impl Clone for AbsoluteEvent
impl Clone for AbsoluteEvent
source§fn clone(&self) -> AbsoluteEvent
fn clone(&self) -> AbsoluteEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AbsoluteEvent
impl Debug for AbsoluteEvent
source§impl<'de> Deserialize<'de> for AbsoluteEvent
impl<'de> Deserialize<'de> for AbsoluteEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<&'a AbsoluteEvent> for &'a InputEvent
impl<'a> From<&'a AbsoluteEvent> for &'a InputEvent
source§fn from(event: &'a AbsoluteEvent) -> Self
fn from(event: &'a AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a AbsoluteEvent> for EventRef<'a>
impl<'a> From<&'a AbsoluteEvent> for EventRef<'a>
source§fn from(event: &'a AbsoluteEvent) -> Self
fn from(event: &'a AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a AbsoluteEvent> for InputEvent
impl<'a> From<&'a AbsoluteEvent> for InputEvent
source§fn from(event: &'a AbsoluteEvent) -> Self
fn from(event: &'a AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a mut AbsoluteEvent> for EventMut<'a>
impl<'a> From<&'a mut AbsoluteEvent> for EventMut<'a>
source§fn from(event: &'a mut AbsoluteEvent) -> Self
fn from(event: &'a mut AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl From<AbsoluteEvent> for Event
impl From<AbsoluteEvent> for Event
source§fn from(event: AbsoluteEvent) -> Self
fn from(event: AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl From<AbsoluteEvent> for InputEvent
impl From<AbsoluteEvent> for InputEvent
source§fn from(event: AbsoluteEvent) -> Self
fn from(event: AbsoluteEvent) -> Self
Converts to this type from the input type.
source§impl GenericEvent for AbsoluteEvent
impl GenericEvent for AbsoluteEvent
source§fn event_kind(&self) -> EventKind
fn event_kind(&self) -> EventKind
The event kind.
source§fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
Interprets a generic event reference into a concrete event type.
source§fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
Interprets a mutable generic event reference into a concrete event type.
source§impl Hash for AbsoluteEvent
impl Hash for AbsoluteEvent
source§impl Ord for AbsoluteEvent
impl Ord for AbsoluteEvent
source§fn cmp(&self, other: &AbsoluteEvent) -> Ordering
fn cmp(&self, other: &AbsoluteEvent) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AbsoluteEvent> for AbsoluteEvent
impl PartialEq<AbsoluteEvent> for AbsoluteEvent
source§fn eq(&self, other: &AbsoluteEvent) -> bool
fn eq(&self, other: &AbsoluteEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AbsoluteEvent> for AbsoluteEvent
impl PartialOrd<AbsoluteEvent> for AbsoluteEvent
source§fn partial_cmp(&self, other: &AbsoluteEvent) -> Option<Ordering>
fn partial_cmp(&self, other: &AbsoluteEvent) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl Serialize for AbsoluteEvent
impl Serialize for AbsoluteEvent
source§impl<'a> TryFrom<&'a InputEvent> for &'a AbsoluteEvent
impl<'a> TryFrom<&'a InputEvent> for &'a AbsoluteEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a mut InputEvent> for &'a mut AbsoluteEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut AbsoluteEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for AbsoluteEvent
impl TryFrom<InputEvent> for AbsoluteEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.