mouse_rs/
lib.rs

1//! ![Rust](https://github.com/DankDumpster/mouse-rs/workflows/Rust/badge.svg)
2//! # Mouse-rs
3//!
4//! Mouse-rs is a rust library for controlling your mouse from a rust program, without having to go into your kernel yourself.
5//!
6//! This project was loosely based on the python [mouse](https://github.com/boppreh/mouse/) library.
7//! Currently it only supports windows based machines but I plan on adding unix later.
8//!
9//! ## Installation
10//! Add mouse-rs to your cargo.toml
11//!
12//! ```toml
13//! [dependencies]
14//! mouse-rs = "0.4"
15//! ```
16//!
17//! ## Example
18//! This is a simple example that moves your mouse to a position on screen and presses the left button.
19//!
20//! ```no_run
21//! use mouse_rs::{types::keys::Keys, Mouse};
22//!
23//! fn move_and_press() {
24//!     let mouse = Mouse::new();
25//!     mouse.move_to(500, 500).expect("Unable to move mouse");
26//!     mouse.press(&Keys::RIGHT).expect("Unable to press button");
27//!     mouse.release(&Keys::RIGHT).expect("Unable to release button");
28//! }
29//! ```
30//!
31//! ## Linux disclaimer
32//! If you're running into problems building on linux you need to install libxdo-dev.
33//!
34//! #### Ubuntu
35//! ```bash
36//! sudo apt-get install libxdo-dev
37//! ```
38
39mod mouse;
40mod sys;
41pub mod types;
42
43pub use mouse::Mouse;