#mouse #readmouse

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

#126 in macOS and iOS APIs

Download history 962/week @ 2024-12-09 866/week @ 2024-12-16 446/week @ 2024-12-23 569/week @ 2024-12-30 800/week @ 2025-01-06 1107/week @ 2025-01-13 969/week @ 2025-01-20 729/week @ 2025-01-27 951/week @ 2025-02-03 1331/week @ 2025-02-10 1051/week @ 2025-02-17 1459/week @ 2025-02-24 1046/week @ 2025-03-03 1491/week @ 2025-03-10 1486/week @ 2025-03-17 1081/week @ 2025-03-24

5,171 downloads per month
Used in 36 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