Crates.io | readmouse |
lib.rs | readmouse |
version | 0.2.1 |
source | src |
created_at | 2019-12-28 13:48:28.372863 |
updated_at | 2019-12-29 16:40:47.220905 |
description | A very small library for reading the mouse location and mouse button presses on macOS. |
homepage | https://github.com/segeljakt/readmouse |
repository | https://github.com/segeljakt/readmouse |
max_upload_size | |
id | 192947 |
size | 4,973 |
A very small library for reading the mouse location and mouse button presses on macOS.
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()
);
}
}
readkey - Find out if a key on the keyboard is currently pressed on macOS.