Keyflow
Cross-platform input simulation library for Rust. Simulate keyboard and mouse input, and register global hotkeys on Linux and Windows.
Optional Features
[]
= { = "0.1", = ["serde"] }
serde- Enable serialization/deserialization of input events
Quick Start
use *;
Platform Requirements
Linux
Keyflow requires access to /dev/uinput for input simulation. Add your user to the input group:
Then log out and back in, or run your program with sudo.
Note: On Linux, the virtual device may take 1-2 seconds to be fully registered after initialization.
Hotkeys on Linux: When hotkeys are enabled, Keyflow grabs keyboard devices to detect key combinations. Do not enable hotkeys if you need to read keyboard input yourself (e.g., for key remapping applications).
Windows
No special permissions required.
Examples
Full examples are available in 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
Limitations
- Linux device creation: May take 1-2 seconds for the virtual device to be fully registered
- Hotkeys on Linux: Grabs keyboard devices, which may conflict with other input monitoring tools