pub struct MouseReport {
pub buttons: MouseButtons,
pub x: i8,
pub y: i8,
pub wheel: i8,
}Expand description
Decoded mouse report (USB HID boot protocol, 4 bytes).
All standard USB mice support this layout in boot protocol mode.
Fields§
Button state. Use the MouseButtons constants or check bits directly.
x: i8Horizontal movement since last report (signed, positive = right).
y: i8Vertical movement since last report (signed, positive = down).
wheel: i8Scroll wheel movement (signed, positive = scroll up / away from user).
Implementations§
Source§impl MouseReport
impl MouseReport
Sourcepub const BUTTON_LEFT: MouseButtons = 1u8
pub const BUTTON_LEFT: MouseButtons = 1u8
Left mouse button.
Sourcepub const BUTTON_RIGHT: MouseButtons = 2u8
pub const BUTTON_RIGHT: MouseButtons = 2u8
Right mouse button.
Sourcepub const BUTTON_MIDDLE: MouseButtons = 4u8
pub const BUTTON_MIDDLE: MouseButtons = 4u8
Middle mouse button (scroll wheel click).
Trait Implementations§
Source§impl Clone for MouseReport
impl Clone for MouseReport
Source§fn clone(&self) -> MouseReport
fn clone(&self) -> MouseReport
Returns a duplicate 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 MouseReport
impl Debug for MouseReport
Source§impl Default for MouseReport
impl Default for MouseReport
Source§fn default() -> MouseReport
fn default() -> MouseReport
Returns the “default value” for a type. Read more
Source§impl Format for MouseReportwhere
MouseButtons: Format,
impl Format for MouseReportwhere
MouseButtons: Format,
Source§impl PartialEq for MouseReport
impl PartialEq for MouseReport
impl Eq for MouseReport
impl StructuralPartialEq for MouseReport
Auto Trait Implementations§
impl Freeze for MouseReport
impl RefUnwindSafe for MouseReport
impl Send for MouseReport
impl Sync for MouseReport
impl Unpin for MouseReport
impl UnwindSafe for MouseReport
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