Skip to content

Rust crate to get mouse position on Linux, MacOS, and Windows.

License

Notifications You must be signed in to change notification settings

yurivict/mouse_position

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rust crate to get mouse position on Linux, MacOS, and Windows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Rust 100.0%