inputbot 0.1.0

A library for creating global hotkeys, as well as emulating mouse and keyboard input.
docs.rs failed to build inputbot-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: inputbot-0.6.0

InputBot alt text

A very small AutoHotkey inspired library for creating global hotkeys, as well as emulating mouse and keyboard input.

How-To

Hotkeys can be created by matching input within a capture loop.

The code below demonstrates how to create a rapidfire hotkey for videogames.

extern crate inputbot;

use inputbot::{capture_input, get_key_state, send_input};
use inputbot::Input::Mouse;
use inputbot::MouseInput::{PressLeft, ReleaseLeft, PressRight};
use std::time::Duration;
use std::thread::sleep;

fn main() {
    while let Some(input) = capture_input() {
        match input {
            Mouse(PressRight, _, _) => {
                while get_key_state(0x02) {
                    send_input(Mouse(PressLeft, 0, 0));
                    sleep(Duration::from_millis(50));
                    send_input(Mouse(ReleaseLeft, 0, 0));
                }
            },
            _ => {}
        }
    }
}

Check out the examples for more code samples, or read the documentation.