#[repr(C)]pub struct InputEvent {
pub time: u64,
pub type_: u16,
pub code: u16,
pub value: i32,
}Expand description
Input event structure
Conceptually similar to Linux’s input_event, but with a Rust-friendly u64 timestamp (nanoseconds since boot) instead of timeval. The type/code/value model is preserved for compatibility.
Fields§
§time: u64Timestamp in nanoseconds since boot
type_: u16Event type (EV_KEY, EV_REL, etc.)
code: u16Event code (KEY_A, REL_X, etc.)
value: i32Event value (1/0 for keys, movement delta for relative axes, etc.)
Implementations§
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
Returns a duplicate of the value. Read more
1.0.0§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 Default for InputEvent
impl Default for InputEvent
Source§fn default() -> InputEvent
fn default() -> InputEvent
Returns the “default value” for a type. Read more
impl Copy for InputEvent
Auto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin for InputEvent
impl UnwindSafe for InputEvent
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)