#[repr(u16)]pub enum EventKind {
Show 33 variants
Synchronize = 0,
Key = 1,
Relative = 2,
Absolute = 3,
Misc = 4,
Switch = 5,
Unknown6 = 6,
Unknown7 = 7,
Unknown8 = 8,
Unknown9 = 9,
UnknownA = 10,
UnknownB = 11,
UnknownC = 12,
UnknownD = 13,
UnknownE = 14,
UnknownF = 15,
Unknown10 = 16,
Led = 17,
Sound = 18,
Unknown13 = 19,
Autorepeat = 20,
ForceFeedback = 21,
Power = 22,
ForceFeedbackStatus = 23,
Unknown18 = 24,
Unknown19 = 25,
Unknown1A = 26,
Unknown1B = 27,
Unknown1C = 28,
Unknown1D = 29,
Unknown1E = 30,
Unknown1F = 31,
UInput = 257,
}
Expand description
Event types
Variants§
Synchronize = 0
Key = 1
Relative = 2
Absolute = 3
Misc = 4
Switch = 5
Unknown6 = 6
Unknown7 = 7
Unknown8 = 8
Unknown9 = 9
UnknownA = 10
UnknownB = 11
UnknownC = 12
UnknownD = 13
UnknownE = 14
UnknownF = 15
Unknown10 = 16
Led = 17
Sound = 18
Unknown13 = 19
Autorepeat = 20
ForceFeedback = 21
Power = 22
ForceFeedbackStatus = 23
Unknown18 = 24
Unknown19 = 25
Unknown1A = 26
Unknown1B = 27
Unknown1C = 28
Unknown1D = 29
Unknown1E = 30
Unknown1F = 31
UInput = 257
Implementations§
Source§impl EventKind
impl EventKind
Sourcepub fn from_type(code: u16) -> Result<Self, RangeError>
pub fn from_type(code: u16) -> Result<Self, RangeError>
Instantiate from a type code.
Sourcepub fn count(&self) -> Result<usize, ()>
pub fn count(&self) -> Result<usize, ()>
Returns the maximum known number of codes for the current event
Sourcepub fn count_bits(&self) -> Result<usize, ()>
pub fn count_bits(&self) -> Result<usize, ()>
Like count
but with an exception for
Synchronize
representing EventKind
, matching
the behaviour of EVIOCGBIT
and EVIOCGMASK
. If you’re using a
bitmask you probably want this.
Trait Implementations§
Source§impl BitmaskTrait for EventKind
impl BitmaskTrait for EventKind
Source§fn array_default() -> Self::Array
fn array_default() -> Self::Array
The default empty state of the bitmask.
Source§fn array_slice(array: &Self::Array) -> &[u8] ⓘ
fn array_slice(array: &Self::Array) -> &[u8] ⓘ
A representation of the bitmask as a slice of bytes.
Source§impl<'de> Deserialize<'de> for EventKind
impl<'de> Deserialize<'de> for EventKind
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 IterableEnum for EventKind
impl IterableEnum for EventKind
Source§impl Ord for EventKind
impl Ord for EventKind
Source§impl PartialOrd for EventKind
impl PartialOrd for EventKind
impl Copy for EventKind
impl Eq for EventKind
impl StructuralPartialEq for EventKind
Auto Trait Implementations§
impl Freeze for EventKind
impl RefUnwindSafe for EventKind
impl Send for EventKind
impl Sync for EventKind
impl Unpin for EventKind
impl UnwindSafe for EventKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more