enigo 0.2.0-rc2

Cross-platform (Linux, Windows & macOS) library to simulate keyboard and mouse events
Documentation

Build status Docs Dependency status

Rust version Crates.io

enigo

Cross platform input simulation in Rust!

  • Linux (X11) mouse
  • Linux (X11) text
  • Linux (Wayland) mouse
  • Linux (Wayland) text
  • MacOS mouse
  • MacOS text
  • Win mouse
  • Win text
  • Serialize/Deserialize
let mut enigo = Enigo::new(&Settings::default()).unwrap();

enigo.move_mouse(500, 200, Abs).unwrap();
enigo.button(Button::Left, Click).unwrap();
enigo.text("Hello World! here is a lot of text  ❤️").unwrap();

For more look at the examples.

Runtime dependencies

Linux users may have to install libxdo-dev if they are using X11. For example, on Debian-based distros:

apt-get install libxdo-dev

On Arch:

pacman -S xdotool

On Fedora:

dnf install libX11-devel libxdo-devel

On Gentoo:

emerge -a xdotool

Migrating from a previous version

Please have a look at our changelog to find out what you have to do, if you used a previous version.

Permissions

Some platforms have security measures in place to prevent programs from entering keys or controlling the mouse. Have a look at the permissions documentation to see what you need to do to allow it.