An open API service indexing awesome lists of open source software.

https://github.com/fayez-nazzal/mouse_position

Rust crate to get mouse position on Linux, MacOS, and Windows.
https://github.com/fayez-nazzal/mouse_position

crate linux macos mouse position rust windows

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

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:

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