Description
enigo is a cross-platform Rust library for simulating keyboard and mouse input. It lets a program move the mouse, press keys and type text as if a person were using the machine. Support is in place for Windows, for macOS, and for Linux on X11 for both mouse and text. Wayland and libei support for mouse and text on Linux are marked experimental, and they are hidden behind feature flags because of known bugs. The library can also work on BSD systems that run X11 or Wayland, though the project has not tested that. An optional serde feature lets you serialize and deserialize input commands, which is useful for sending them between processes. On Linux, different system mechanisms are available, and not every system supports every method. On Windows, mouse coordinates and display size use physical pixels, and enigo switches the calling thread to per-monitor DPI awareness for those queries. Some platforms restrict programs from sending keys or moving the mouse, so the project's permissions documentation explains what to allow. Linux users may need the libxdo development package for the xdo feature. The repository includes examples, a changelog for migrations, debugging instructions and notes on testing. The tests move the mouse, type text and press keys, so the project advises running them sequentially on a machine that is not in use. The source is on GitHub at enigo-rs/enigo.…
Highlights
- Mouse and keyboard input on Windows, macOS and Linux
- X11 text and mouse support
- Experimental Wayland and libei support
- Optional serde for input commands
- Physical pixel coordinates on Windows
Ratings & Reviews
No ratings yet
Be the first to rate Enigo.
People also visit
Enigo FAQ
What is enigo?
A cross-platform Rust library for simulating mouse and keyboard input.
Which platforms work?
Windows, macOS and Linux on X11. Wayland and libei are experimental on Linux, and BSD works if it runs X11 or Wayland but is not tested.
Can I save input commands?
Yes. Enable the serde feature to serialize and deserialize commands.
Why might input fail?
Some platforms restrict programs from entering keys or controlling the mouse. The permissions documentation explains what to allow.
What do I install on Linux?
libxdo-dev if you use the xdo feature, with the package name given for Debian, Arch, Fedora and Gentoo.
Is it safe to run the tests?
The project warns that the tests move the mouse, type and open applications, so close everything first and run them one at a time.
What are the best Enigo alternatives?
Popular alternatives to Enigo include CrossMacro, Mousemaster and Keymapper. See all Enigo alternatives




