pub struct Mouse;Expand description
A mouse
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub fn update(&self)
pub fn update(&self)
Update previous status of buttons
The previous status of mouse buttons is used to detect clicks. A click happens when the previous status was down and the current status is up.
Sourcepub fn coordinates(&self) -> (i16, i16)
pub fn coordinates(&self) -> (i16, i16)
Get the coordinates
Sourcepub fn left_pressed(&self) -> bool
pub fn left_pressed(&self) -> bool
Check whether left button is pressed
Sourcepub fn right_pressed(&self) -> bool
pub fn right_pressed(&self) -> bool
Check whether left button is pressed
Sourcepub fn middle_pressed(&self) -> bool
pub fn middle_pressed(&self) -> bool
Check whether left button is pressed
Sourcepub fn left_clicked(&self) -> bool
pub fn left_clicked(&self) -> bool
Check whether left button was clicked
Sourcepub fn right_clicked(&self) -> bool
pub fn right_clicked(&self) -> bool
Check whether right button was clicked
Sourcepub fn middle_clicked(&self) -> bool
pub fn middle_clicked(&self) -> bool
Check whether middle button was clicked
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mouse
impl RefUnwindSafe for Mouse
impl Send for Mouse
impl Sync for Mouse
impl Unpin for Mouse
impl UnwindSafe for Mouse
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