#mouse #position #linux #linux-windows #linux-macos #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

#687 in GUI

Download history 288/week @ 2023-11-18 296/week @ 2023-11-25 194/week @ 2023-12-02 241/week @ 2023-12-09 274/week @ 2023-12-16 350/week @ 2023-12-23 185/week @ 2023-12-30 353/week @ 2024-01-06 190/week @ 2024-01-13 156/week @ 2024-01-20 245/week @ 2024-01-27 476/week @ 2024-02-03 310/week @ 2024-02-10 543/week @ 2024-02-17 596/week @ 2024-02-24 379/week @ 2024-03-02

1,863 downloads per month
Used in oculante

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–380KB