#[repr(C, packed(1))]pub struct BootMouseReport {
pub buttons: u8,
pub x_displacement: i8,
pub y_displacement: i8,
pub scroll: i8,
}Expand description
Boot mouse report: 3 bytes minimum, optional 4th byte for scroll
Byte 0: Button bitmask (bit 0 = left, bit 1 = right, bit 2 = middle) Byte 1: X displacement (signed, -127 to +127) Byte 2: Y displacement (signed, -127 to +127) Byte 3 (optional): Scroll wheel (signed)
Fields§
§x_displacement: i8§y_displacement: i8§scroll: i8Implementations§
Source§impl BootMouseReport
impl BootMouseReport
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, KernelError>
pub fn from_bytes(data: &[u8]) -> Result<Self, KernelError>
Parse raw bytes into a mouse report (3 or 4 bytes)
Check if the left button is pressed
Check if the right button is pressed
Check if the middle button is pressed
Trait Implementations§
Source§impl Clone for BootMouseReport
impl Clone for BootMouseReport
Source§fn clone(&self) -> BootMouseReport
fn clone(&self) -> BootMouseReport
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 BootMouseReport
impl Debug for BootMouseReport
impl Copy for BootMouseReport
Auto Trait Implementations§
impl Freeze for BootMouseReport
impl RefUnwindSafe for BootMouseReport
impl Send for BootMouseReport
impl Sync for BootMouseReport
impl Unpin for BootMouseReport
impl UnwindSafe for BootMouseReport
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)