#input #mouse #keyboard #automation

enigo

Enigo lets you control your mouse and keyboard in an abstract way on different operating systems (currently only Linux, macOS, Win – Redox and *BSD planned)

18 releases

0.1.3 Sep 1, 2023
0.1.2 Apr 3, 2023
0.1.1 Mar 30, 2023
0.0.14 Mar 7, 2020
0.0.7 Feb 5, 2017

#23 in Hardware support

Download history 513/week @ 2023-06-06 691/week @ 2023-06-13 980/week @ 2023-06-20 934/week @ 2023-06-27 858/week @ 2023-07-04 631/week @ 2023-07-11 713/week @ 2023-07-18 629/week @ 2023-07-25 448/week @ 2023-08-01 650/week @ 2023-08-08 903/week @ 2023-08-15 416/week @ 2023-08-22 607/week @ 2023-08-29 846/week @ 2023-09-05 710/week @ 2023-09-12 571/week @ 2023-09-19

2,791 downloads per month
Used in 30 crates (24 directly)

MIT license

96KB
2K SLoC

Build status Docs Dependency status

Rust version Crates.io Discord chat Gitter chat

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
  • Custom Parser
let mut enigo = Enigo::new();

enigo.mouse_move_to(500, 200);
enigo.mouse_click(MouseButton::Left);
enigo.key_sequence_parse("{+CTRL}a{-CTRL}{+SHIFT}Hello World{-SHIFT}");

For more look at examples

Runtime dependencies

Linux users may have to install libxdo-dev. 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.

Dependencies

~0–50MB
~758K SLoC