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.
- Host: GitHub
- URL: https://github.com/fayez-nazzal/mouse_position
- Owner: fayez-nazzal
- License: mit
- Created: 2022-12-13T06:44:21.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-31T12:42:34.000Z (over 1 year ago)
- Last Synced: 2025-04-06T18:37:21.746Z (6 months ago)
- Topics: crate, linux, macos, mouse, position, rust, windows
- Language: Rust
- Homepage: https://crates.io/crates/mouse_position
- Size: 18.6 KB
- Stars: 9
- Watchers: 1
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"),
}
}
```