Crate mouse_position

Source
Expand description

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

Modulesยง

impl_linux
Implementation for Linux.
impl_macos
Implementation for MacOS.
impl_windows
Implementation for Windows.
mouse_position
Contains the used structs and enums to get the mouse position.