#mouse #position #linux #windows #macos

bin+lib mouse_position

Get the mouse position on Linux, Windows and MacOS

3 releases

0.1.3 Dec 15, 2022
0.1.1 Dec 15, 2022
0.1.0 Dec 15, 2022

#709 in GUI

Download history 85/week @ 2023-08-05 51/week @ 2023-08-12 60/week @ 2023-08-19 271/week @ 2023-08-26 624/week @ 2023-09-02 357/week @ 2023-09-09 470/week @ 2023-09-16 320/week @ 2023-09-23 163/week @ 2023-09-30 316/week @ 2023-10-07 274/week @ 2023-10-14 242/week @ 2023-10-21 204/week @ 2023-10-28 255/week @ 2023-11-04 142/week @ 2023-11-11 319/week @ 2023-11-18

936 downloads per month

MIT license

7KB
97 lines

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"),
   }
}

lib.rs:

A 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"),
   }
}

Dependencies

~0–360KB