#[repr(u16)]pub enum Mouse {
Left = 0,
Right = 1,
Center = 2,
}Variants§
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub fn location() -> (f64, f64)
pub fn location() -> (f64, f64)
Returns the current mouse location.
use readmouse::Mouse;
loop {
println!("(x,y) = {:?}", Mouse::location());
}Sourcepub fn is_pressed(self) -> bool
pub fn is_pressed(self) -> bool
Checks if mouse button is pressed.
use readmouse::Mouse;
loop {
println!("Left button pressed? {:?}", Mouse::Left.is_pressed());
}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