mouse_position

Crates.iomouse_position
lib.rsmouse_position
version0.1.4
sourcesrc
created_at2022-12-15 20:33:47.305225
updated_at2024-05-31 12:42:39.475333
descriptionGet the mouse position on Linux, Windows and MacOS
homepage
repositoryhttps://github.com/fayez-nazzal/mouse_position
max_upload_size
id738311
size11,114
Fayez Nazzal (fayez-nazzal)

documentation

README

Mouse Position

A simple crate to get the mouse position in a cross platform way. It uses winapi crate to get the mouse position on windows, x11-dl for linux, and core-graphics for macos.

Example Usage:

use mouse_position::mouse_position::{Mouse};

fn main() {
    let position = Mouse::get_mouse_position();
    match position {
        Mouse::Position { x, y } => println!("x: {}, y: {}", x, y),
        Mouse::Error => println!("Error getting mouse position"),
   }
}
Commit count: 19

cargo fmt