A very small AutoHotkey inspired library for creating global hotkeys, as well as emulating mouse and keyboard input.
Hotkeys can be created by matching input within a capture loop.
The code below demonstrates how to create a rapidfire hotkey for videogames.
```Rust extern crate inputbot;
use inputbot::{captureinput, getkeystate, sendinput}; use inputbot::Input::Mouse; use inputbot::MouseInput::{PressLeft, ReleaseLeft, PressRight}; use std::time::Duration; use std::thread::sleep;
fn main() { while let Some(input) = captureinput() { match input { Mouse(PressRight, _, _) => { while getkeystate(0x02) { sendinput(Mouse(PressLeft, 0, 0)); sleep(Duration::frommillis(50)); sendinput(Mouse(ReleaseLeft, 0, 0)); } }, _ => {} } } } ```
Check out the examples for more code samples, or read the documentation.