pub struct SwitchEvent(/* private fields */);Expand description
A switch state change.
Implementations§
Methods from Deref<Target = InputEvent>§
Sourcepub fn time(&self) -> SystemTime
pub fn time(&self) -> SystemTime
Returns the timestamp stored in the event.
The clock source used to generate event timestamps can be changed by calling
Evdev::set_clockid.
Sourcepub fn kind(&self) -> EventKind
pub fn kind(&self) -> EventKind
Returns the EventKind this InputEvent encodes.
EventKind is a matchable, type-safe enum which is intended to be the primary way most
applications examine input events.
EventKind is #[non_exhaustive], so matching on it requires a wildcard arm that will
catch any events that don’t have a specific EventKind variant.
Future versions of evdevil might add new variants to catch those events.
Sourcepub fn event_type(&self) -> EventType
pub fn event_type(&self) -> EventType
Returns the EventType of this event.
Sourcepub fn raw_code(&self) -> u16
pub fn raw_code(&self) -> u16
Returns the raw event code field.
The code of an InputEvent generally describes what entity the event is describing.
Depending on the type of event, it can describe a key, axis, sound, LED, or other entity.
Sourcepub fn raw_value(&self) -> i32
pub fn raw_value(&self) -> i32
Returns the raw event value field.
The value of an InputEvent describes the new state of the key, axis, LED, or other
entity.
Trait Implementations§
Source§impl Clone for SwitchEvent
impl Clone for SwitchEvent
Source§fn clone(&self) -> SwitchEvent
fn clone(&self) -> SwitchEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SwitchEvent
Source§impl Debug for SwitchEvent
impl Debug for SwitchEvent
Source§impl Deref for SwitchEvent
impl Deref for SwitchEvent
Source§type Target = InputEvent
type Target = InputEvent
Source§fn deref(&self) -> &InputEvent
fn deref(&self) -> &InputEvent
impl Eq for SwitchEvent
Source§impl From<SwitchEvent> for EventKind
impl From<SwitchEvent> for EventKind
Source§fn from(value: SwitchEvent) -> Self
fn from(value: SwitchEvent) -> Self
Source§impl From<SwitchEvent> for InputEvent
impl From<SwitchEvent> for InputEvent
Source§fn from(value: SwitchEvent) -> Self
fn from(value: SwitchEvent) -> Self
Source§impl PartialEq for SwitchEvent
impl PartialEq for SwitchEvent
Source§fn eq(&self, other: &SwitchEvent) -> bool
fn eq(&self, other: &SwitchEvent) -> bool
self and other values to be equal, and is used by ==.