Struct linux_input_sys::virtio_input_event
source · #[repr(C)]pub struct virtio_input_event {
pub type_: Le16,
pub code: Le16,
pub value: SLe32,
}
Fields§
§type_: Le16
§code: Le16
§value: SLe32
Implementations§
source§impl virtio_input_event
impl virtio_input_event
pub fn syn() -> virtio_input_event
pub fn absolute(code: u16, value: i32) -> virtio_input_event
pub fn relative(code: u16, value: i32) -> virtio_input_event
pub fn multitouch_tracking_id(id: i32) -> virtio_input_event
pub fn multitouch_slot(slot: i32) -> virtio_input_event
pub fn multitouch_absolute_x(x: i32) -> virtio_input_event
pub fn multitouch_absolute_y(y: i32) -> virtio_input_event
pub fn absolute_x(x: i32) -> virtio_input_event
pub fn absolute_y(y: i32) -> virtio_input_event
pub fn relative_x(x: i32) -> virtio_input_event
pub fn relative_y(y: i32) -> virtio_input_event
pub fn touch(has_contact: bool) -> virtio_input_event
pub fn left_click(has_contact: bool) -> virtio_input_event
pub fn wheel(delta: i32) -> virtio_input_event
pub fn right_click(has_contact: bool) -> virtio_input_event
pub fn middle_click(has_contact: bool) -> virtio_input_event
pub fn forward_click(has_contact: bool) -> virtio_input_event
pub fn back_click(has_contact: bool) -> virtio_input_event
pub fn finger_tool(active: bool) -> virtio_input_event
sourcepub fn key(code: u16, down: bool, repeat: bool) -> virtio_input_event
pub fn key(code: u16, down: bool, repeat: bool) -> virtio_input_event
Repeated keys must set the repeat
option if the key was already down, or repeated keys
will not be seen correctly by the guest.
sourcepub fn get_led_state(&self, led_code: u16) -> Option<bool>
pub fn get_led_state(&self, led_code: u16) -> Option<bool>
If the event is EV_LED for the given LED code, return if it is on.
Trait Implementations§
source§impl AsBytes for virtio_input_eventwhere
Le16: AsBytes,
SLe32: AsBytes,
HasPadding<virtio_input_event, { _ }>: ShouldBe<false>,
impl AsBytes for virtio_input_eventwhere
Le16: AsBytes,
SLe32: AsBytes,
HasPadding<virtio_input_event, { _ }>: ShouldBe<false>,
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
source§impl Clone for virtio_input_event
impl Clone for virtio_input_event
source§fn clone(&self) -> virtio_input_event
fn clone(&self) -> virtio_input_event
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 virtio_input_event
impl Debug for virtio_input_event
source§impl Default for virtio_input_event
impl Default for virtio_input_event
source§fn default() -> virtio_input_event
fn default() -> virtio_input_event
Returns the “default value” for a type. Read more
source§impl FromBytes for virtio_input_eventwhere
Le16: FromBytes,
SLe32: FromBytes,
impl FromBytes for virtio_input_eventwhere
Le16: FromBytes,
SLe32: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
Interprets the prefix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
Interprets the suffix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
Interprets the prefix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
Interprets the suffix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
source§impl FromZeroes for virtio_input_eventwhere
Le16: FromZeroes,
SLe32: FromZeroes,
impl FromZeroes for virtio_input_eventwhere
Le16: FromZeroes,
SLe32: FromZeroes,
source§impl PartialEq for virtio_input_event
impl PartialEq for virtio_input_event
source§fn eq(&self, other: &virtio_input_event) -> bool
fn eq(&self, other: &virtio_input_event) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for virtio_input_event
impl Eq for virtio_input_event
impl StructuralPartialEq for virtio_input_event
Auto Trait Implementations§
impl RefUnwindSafe for virtio_input_event
impl Send for virtio_input_event
impl Sync for virtio_input_event
impl Unpin for virtio_input_event
impl UnwindSafe for virtio_input_event
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