Struct input_linux::InputEvent
source · #[repr(C)]pub struct InputEvent {
pub time: EventTime,
pub kind: EventKind,
pub code: u16,
pub value: i32,
}
Expand description
A generic event.
Fields§
§time: EventTime
The timestamp associated with the event.
kind: EventKind
The type of event that occurred.
code: u16
The code of the event.
The meaning of this code depends on the kind
of event. Using the typed
events via Event
and EventRef
is recommended.
value: i32
The value of the event.
The interpretation of this value depends on the kind
of event.
Implementations§
source§impl InputEvent
impl InputEvent
source§impl InputEvent
impl InputEvent
sourcepub fn from_raw(event: &input_event) -> Result<&Self, RangeError>
pub fn from_raw(event: &input_event) -> Result<&Self, RangeError>
Reinterprets a raw [input_event
].
sourcepub fn from_raw_mut(event: &mut input_event) -> Result<&mut Self, RangeError>
pub fn from_raw_mut(event: &mut input_event) -> Result<&mut Self, RangeError>
Reinterprets a raw [input_event
] into a mutable reference.
sourcepub unsafe fn as_raw_mut(&mut self) -> &mut input_event
pub unsafe fn as_raw_mut(&mut self) -> &mut input_event
Reinterprets the event as a mutable raw [input_event
].
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<InputEvent> for AutorepeatEvent
impl AsRef<InputEvent> for AutorepeatEvent
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<InputEvent> for Event
impl AsRef<InputEvent> for Event
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<'a> AsRef<InputEvent> for EventMut<'a>
impl<'a> AsRef<InputEvent> for EventMut<'a>
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<'a> AsRef<InputEvent> for EventRef<'a>
impl<'a> AsRef<InputEvent> for EventRef<'a>
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<InputEvent> for InputEvent
impl AsRef<InputEvent> for InputEvent
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<InputEvent> for KeyEvent
impl AsRef<InputEvent> for KeyEvent
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<InputEvent> for LedEvent
impl AsRef<InputEvent> for LedEvent
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<InputEvent> for MiscEvent
impl AsRef<InputEvent> for MiscEvent
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<InputEvent> for RelativeEvent
impl AsRef<InputEvent> for RelativeEvent
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<InputEvent> for SoundEvent
impl AsRef<InputEvent> for SoundEvent
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<InputEvent> for SwitchEvent
impl AsRef<InputEvent> for SwitchEvent
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<InputEvent> for SynchronizeEvent
impl AsRef<InputEvent> for SynchronizeEvent
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<InputEvent> for UInputEvent
impl AsRef<InputEvent> for UInputEvent
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 InputEvent
impl AsRef<input_event> for InputEvent
source§impl Clone for InputEvent
impl Clone for InputEvent
source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
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 InputEvent
impl Debug for InputEvent
source§impl<'de> Deserialize<'de> for InputEvent
impl<'de> Deserialize<'de> for InputEvent
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
§impl Encoder<InputEvent> for EventCodec
Available on crate features tokio-util-0_7
and codec
only.
impl Encoder<InputEvent> for EventCodec
Available on crate features
tokio-util-0_7
and codec
only.§impl Encoder<InputEvent> for EventCodec
Available on crate features tokio-util-0_6
and codec
only.
impl Encoder<InputEvent> for EventCodec
Available on crate features
tokio-util-0_6
and codec
only.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 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 AutorepeatEvent> for &'a InputEvent
impl<'a> From<&'a AutorepeatEvent> for &'a InputEvent
source§fn from(event: &'a AutorepeatEvent) -> Self
fn from(event: &'a AutorepeatEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a AutorepeatEvent> for InputEvent
impl<'a> From<&'a AutorepeatEvent> for InputEvent
source§fn from(event: &'a AutorepeatEvent) -> Self
fn from(event: &'a AutorepeatEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a EventMut<'a>> for &'a InputEvent
impl<'a> From<&'a EventMut<'a>> for &'a InputEvent
source§impl<'a> From<&'a KeyEvent> for &'a InputEvent
impl<'a> From<&'a KeyEvent> for &'a InputEvent
source§impl<'a> From<&'a KeyEvent> for InputEvent
impl<'a> From<&'a KeyEvent> for InputEvent
source§impl<'a> From<&'a LedEvent> for &'a InputEvent
impl<'a> From<&'a LedEvent> for &'a InputEvent
source§impl<'a> From<&'a LedEvent> for InputEvent
impl<'a> From<&'a LedEvent> for InputEvent
source§impl<'a> From<&'a MiscEvent> for &'a InputEvent
impl<'a> From<&'a MiscEvent> for &'a InputEvent
source§impl<'a> From<&'a MiscEvent> for InputEvent
impl<'a> From<&'a MiscEvent> for InputEvent
source§impl<'a> From<&'a RelativeEvent> for &'a InputEvent
impl<'a> From<&'a RelativeEvent> for &'a InputEvent
source§fn from(event: &'a RelativeEvent) -> Self
fn from(event: &'a RelativeEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a RelativeEvent> for InputEvent
impl<'a> From<&'a RelativeEvent> for InputEvent
source§fn from(event: &'a RelativeEvent) -> Self
fn from(event: &'a RelativeEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SoundEvent> for &'a InputEvent
impl<'a> From<&'a SoundEvent> for &'a InputEvent
source§fn from(event: &'a SoundEvent) -> Self
fn from(event: &'a SoundEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SoundEvent> for InputEvent
impl<'a> From<&'a SoundEvent> for InputEvent
source§fn from(event: &'a SoundEvent) -> Self
fn from(event: &'a SoundEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SwitchEvent> for &'a InputEvent
impl<'a> From<&'a SwitchEvent> for &'a InputEvent
source§fn from(event: &'a SwitchEvent) -> Self
fn from(event: &'a SwitchEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SwitchEvent> for InputEvent
impl<'a> From<&'a SwitchEvent> for InputEvent
source§fn from(event: &'a SwitchEvent) -> Self
fn from(event: &'a SwitchEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SynchronizeEvent> for &'a InputEvent
impl<'a> From<&'a SynchronizeEvent> for &'a InputEvent
source§fn from(event: &'a SynchronizeEvent) -> Self
fn from(event: &'a SynchronizeEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a SynchronizeEvent> for InputEvent
impl<'a> From<&'a SynchronizeEvent> for InputEvent
source§fn from(event: &'a SynchronizeEvent) -> Self
fn from(event: &'a SynchronizeEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a UInputEvent> for &'a InputEvent
impl<'a> From<&'a UInputEvent> for &'a InputEvent
source§fn from(event: &'a UInputEvent) -> Self
fn from(event: &'a UInputEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a UInputEvent> for InputEvent
impl<'a> From<&'a UInputEvent> for InputEvent
source§fn from(event: &'a UInputEvent) -> Self
fn from(event: &'a UInputEvent) -> 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 From<AutorepeatEvent> for InputEvent
impl From<AutorepeatEvent> for InputEvent
source§fn from(event: AutorepeatEvent) -> Self
fn from(event: AutorepeatEvent) -> Self
Converts to this type from the input type.
source§impl From<Event> for InputEvent
impl From<Event> for InputEvent
source§impl<'a> From<EventRef<'a>> for &'a InputEvent
impl<'a> From<EventRef<'a>> for &'a InputEvent
source§impl From<KeyEvent> for InputEvent
impl From<KeyEvent> for InputEvent
source§impl From<LedEvent> for InputEvent
impl From<LedEvent> for InputEvent
source§impl From<MiscEvent> for InputEvent
impl From<MiscEvent> for InputEvent
source§impl From<RelativeEvent> for InputEvent
impl From<RelativeEvent> for InputEvent
source§fn from(event: RelativeEvent) -> Self
fn from(event: RelativeEvent) -> Self
Converts to this type from the input type.
source§impl From<SoundEvent> for InputEvent
impl From<SoundEvent> for InputEvent
source§fn from(event: SoundEvent) -> Self
fn from(event: SoundEvent) -> Self
Converts to this type from the input type.
source§impl From<SwitchEvent> for InputEvent
impl From<SwitchEvent> for InputEvent
source§fn from(event: SwitchEvent) -> Self
fn from(event: SwitchEvent) -> Self
Converts to this type from the input type.
source§impl From<SynchronizeEvent> for InputEvent
impl From<SynchronizeEvent> for InputEvent
source§fn from(event: SynchronizeEvent) -> Self
fn from(event: SynchronizeEvent) -> Self
Converts to this type from the input type.
source§impl From<UInputEvent> for InputEvent
impl From<UInputEvent> for InputEvent
source§fn from(event: UInputEvent) -> Self
fn from(event: UInputEvent) -> Self
Converts to this type from the input type.
source§impl GenericEvent for InputEvent
impl GenericEvent for InputEvent
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 InputEvent
impl Hash for InputEvent
source§impl Ord for InputEvent
impl Ord for InputEvent
source§fn cmp(&self, other: &InputEvent) -> Ordering
fn cmp(&self, other: &InputEvent) -> 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<InputEvent> for InputEvent
impl PartialEq<InputEvent> for InputEvent
source§fn eq(&self, other: &InputEvent) -> bool
fn eq(&self, other: &InputEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<InputEvent> for InputEvent
impl PartialOrd<InputEvent> for InputEvent
source§fn partial_cmp(&self, other: &InputEvent) -> Option<Ordering>
fn partial_cmp(&self, other: &InputEvent) -> 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 InputEvent
impl Serialize for InputEvent
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 InputEvent> for &'a AutorepeatEvent
impl<'a> TryFrom<&'a InputEvent> for &'a AutorepeatEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a KeyEvent
impl<'a> TryFrom<&'a InputEvent> for &'a KeyEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a LedEvent
impl<'a> TryFrom<&'a InputEvent> for &'a LedEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a MiscEvent
impl<'a> TryFrom<&'a InputEvent> for &'a MiscEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a RelativeEvent
impl<'a> TryFrom<&'a InputEvent> for &'a RelativeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a SoundEvent
impl<'a> TryFrom<&'a InputEvent> for &'a SoundEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a SwitchEvent
impl<'a> TryFrom<&'a InputEvent> for &'a SwitchEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a SynchronizeEvent
impl<'a> TryFrom<&'a InputEvent> for &'a SynchronizeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a InputEvent> for &'a UInputEvent
impl<'a> TryFrom<&'a InputEvent> for &'a UInputEvent
§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<'a> TryFrom<&'a mut InputEvent> for &'a mut AutorepeatEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut AutorepeatEvent
§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 KeyEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut KeyEvent
§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 LedEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut LedEvent
§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 MiscEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut MiscEvent
§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 RelativeEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut RelativeEvent
§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 SoundEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SoundEvent
§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 SwitchEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SwitchEvent
§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 SynchronizeEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SynchronizeEvent
§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 UInputEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut UInputEvent
§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.
source§impl TryFrom<InputEvent> for AutorepeatEvent
impl TryFrom<InputEvent> for AutorepeatEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for KeyEvent
impl TryFrom<InputEvent> for KeyEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for LedEvent
impl TryFrom<InputEvent> for LedEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for MiscEvent
impl TryFrom<InputEvent> for MiscEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for RelativeEvent
impl TryFrom<InputEvent> for RelativeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for SoundEvent
impl TryFrom<InputEvent> for SoundEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for SwitchEvent
impl TryFrom<InputEvent> for SwitchEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for SynchronizeEvent
impl TryFrom<InputEvent> for SynchronizeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for UInputEvent
impl TryFrom<InputEvent> for UInputEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.