#mouse #mouse-button #macos #location #read #reading #continuously

readmouse

A very small library for reading the mouse location and mouse button presses on macOS

3 unstable releases

0.2.1 Dec 29, 2019
0.2.0 Dec 28, 2019
0.1.6 Dec 28, 2019

#99 in macOS and iOS APIs

Download history 466/week @ 2024-04-04 602/week @ 2024-04-11 541/week @ 2024-04-18 508/week @ 2024-04-25 548/week @ 2024-05-02 543/week @ 2024-05-09 584/week @ 2024-05-16 539/week @ 2024-05-23 529/week @ 2024-05-30 384/week @ 2024-06-06 435/week @ 2024-06-13 402/week @ 2024-06-20 342/week @ 2024-06-27 291/week @ 2024-07-04 486/week @ 2024-07-11 426/week @ 2024-07-18

1,608 downloads per month
Used in 34 crates (2 directly)

MIT license

4KB

readmouse

A very small library for reading the mouse location and mouse button presses on macOS.

Example usage

Continuously print the mouse location:

use readmouse::Mouse;

fn main() {
    loop {
        println!(
            "L={:?} R={:?} C={:?} (x,y)={:?}",
            Mouse::Left.is_pressed(),
            Mouse::Right.is_pressed(),
            Mouse::Center.is_pressed(),
            Mouse::location()
        );
    }
}

Related

readkey - Find out if a key on the keyboard is currently pressed on macOS.

No runtime deps