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

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

#97 in macOS and iOS APIs

Download history 544/week @ 2023-11-20 541/week @ 2023-11-27 511/week @ 2023-12-04 565/week @ 2023-12-11 513/week @ 2023-12-18 611/week @ 2023-12-25 554/week @ 2024-01-01 423/week @ 2024-01-08 453/week @ 2024-01-15 458/week @ 2024-01-22 465/week @ 2024-01-29 561/week @ 2024-02-05 416/week @ 2024-02-12 412/week @ 2024-02-19 528/week @ 2024-02-26 477/week @ 2024-03-04

1,898 downloads per month
Used in 31 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