Expand description
§Keyflow - Cross-Platform Input Simulation
Simulate keyboard and mouse input on Linux (evdev) and Windows (SendInput) with optional global hotkey support.
§Quick Start
use keyflow::prelude::*;
Keyflow::initialize()?;
Keyflow::press_key(Key::A);
Keyflow::click_button(Button::Left);
Keyflow::move_to(500, 300);§Features
- Keyboard simulation - Press, release, and click keys
- Mouse simulation - Move, click, and scroll
- Global hotkeys - Optional hotkey registration (opt-in via builder)
- Batch processing - Send multiple events efficiently
- Multi-monitor - Full multi-monitor coordinate support
§Linux Permissions
Add your user to the input group:
sudo usermod -aG input $USERThen log out and back in, or run with sudo.
§Hotkeys
use keyflow::prelude::*;
Keyflow::builder()
.with_hotkeys() // Enable hotkey support
.initialize()?;
Keyflow::register_hotkey(
"save",
Hotkey::new(Key::S).with_ctrl(),
|| println!("Ctrl+S pressed!")
)?;§Examples
See the examples directory:
basic.rs- Keyboard and mouse basicshotkeys.rs- Global hotkey registrationbatch.rs- Batch event processingmulti_monitor.rs- Multi-monitor positioningserde_config.rs- Save/load automation scripts (requiresserdefeature)
Modules§
- prelude
- Commonly used imports
Structs§
- Button
Iter - An iterator over the variants of Button
- Hotkey
- Hotkey combination
- KeyIter
- An iterator over the variants of Key
- Keyflow
- Main interface for Keyflow input simulation
- Keyflow
Builder - KeyflowBuilder configures the API
- Screen
- Define the Screen limits
Enums§
- Action
- Input event action
- Button
- Mouse button representation
- Input
Event - Input event types
- Key
- Key representation
- Keyflow
Error - Movement
- Mouse movement type
- Scroll
- Mouse scroll