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 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 ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
Interprets the suffix of the given bytes as a
&Self
. Read more§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
source§impl FromZeros for virtio_input_eventwhere
Le16: FromZeros,
SLe32: FromZeros,
impl FromZeros for virtio_input_eventwhere
Le16: FromZeros,
SLe32: FromZeros,
source§impl IntoBytes for virtio_input_eventwhere
Le16: IntoBytes,
SLe32: IntoBytes,
(): PaddingFree<Self, { _ }>,
impl IntoBytes for virtio_input_eventwhere
Le16: IntoBytes,
SLe32: IntoBytes,
(): PaddingFree<Self, { _ }>,
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
source§impl KnownLayout for virtio_input_eventwhere
SLe32: KnownLayout,
impl KnownLayout for virtio_input_eventwhere
SLe32: KnownLayout,
§type PointerMetadata = <SLe32 as KnownLayout>::PointerMetadata
type PointerMetadata = <SLe32 as KnownLayout>::PointerMetadata
The type of metadata stored in a pointer to
Self
. Read moresource§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 ==
.source§impl TryFromBytes for virtio_input_eventwhere
Le16: TryFromBytes,
SLe32: TryFromBytes,
impl TryFromBytes for virtio_input_eventwhere
Le16: TryFromBytes,
SLe32: TryFromBytes,
§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Copy for virtio_input_event
impl Eq for virtio_input_event
impl Immutable for virtio_input_eventwhere
Le16: Immutable,
SLe32: Immutable,
impl StructuralPartialEq for virtio_input_event
Auto Trait Implementations§
impl Freeze for virtio_input_event
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)