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

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

#94 in macOS and iOS APIs

Download history 563/week @ 2024-01-03 401/week @ 2024-01-10 450/week @ 2024-01-17 523/week @ 2024-01-24 445/week @ 2024-01-31 521/week @ 2024-02-07 427/week @ 2024-02-14 428/week @ 2024-02-21 511/week @ 2024-02-28 516/week @ 2024-03-06 451/week @ 2024-03-13 586/week @ 2024-03-20 493/week @ 2024-03-27 491/week @ 2024-04-03 543/week @ 2024-04-10 464/week @ 2024-04-17

2,066 downloads per month
Used in 32 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