mouse_automation

Crates.iomouse_automation
lib.rsmouse_automation
version0.1.3
sourcesrc
created_at2015-12-27 20:53:19.757995
updated_at2016-01-08 03:14:32.234967
descriptionA winapi wrapper that provides easy mouse automation.
homepagehttps://github.com/obv-mikhail/mouse_automation
repositoryhttps://github.com/obv-mikhail/mouse_automation
max_upload_size
id3768
size3,175
(obv-mikhail)

documentation

https://github.com/obv-mikhail/mouse_automation

README

mouse_automation

A winapi wrapper that provides easy mouse automation. Can be used from a variety of languages.

Installation

Rust

Add this to the toml file:

[dependencies]
mouse_automation = "0.1.1"

Example:

extern crate mouse_automation;

fn main() {
    mouse_automation::move_mouse(0, 0, true); // moves mouse to top left corner
}

Functionality

Moving the mouse

mouse_automation.move_mouse(mut x: i32, mut y: i32, abs: bool);

Third parameter should be true for asbolute movement, and false for relative.

Simulating a click

mouse_automation.LEFT.down();  
mouse_automation.LEFT.up();
mouse_automation.RIGHT.down();  
mouse_automation.RIGHT.up();
mouse_automation.MIDDLE.down();  
mouse_automation.MIDDLE.up();

Two commands are needed to simulate a click, the first sends a down event, and the second an up event.

Wheel scrolling

mouse_automation.wheel(movement: u32);

The sign of the parameter indicates the direction of the scrolling.

Commit count: 31

cargo fmt