#button #mouse-button #macos #location #read

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

#105 in macOS and iOS APIs

Download history 505/week @ 2024-07-21 584/week @ 2024-07-28 522/week @ 2024-08-04 597/week @ 2024-08-11 517/week @ 2024-08-18 791/week @ 2024-08-25 1060/week @ 2024-09-01 857/week @ 2024-09-08 909/week @ 2024-09-15 1128/week @ 2024-09-22 951/week @ 2024-09-29 744/week @ 2024-10-06 737/week @ 2024-10-13 1053/week @ 2024-10-20 837/week @ 2024-10-27 841/week @ 2024-11-03

3,501 downloads per month
Used in 33 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