Crate enigo_copy

source ·
Expand description

Enigo lets you simulate mouse and keyboard input-events as if they were made by the actual hardware. It is available on Linux (X11), macOS and Windows.

It can be used for testing user interfaces on different platforms, building remote control applications or just automating tasks for user interfaces unaccessible by a public API or scripting language.

This library is in an early alpha status, the API will change in in the future.

In order to use the library, you only have to know about three things:

A simple DSL is available. It is documented in the dsl module.


use enigo::*;
let mut enigo = Enigo::new();
use enigo::*;
let mut enigo = Enigo::new();
enigo.mouse_move_to(500, 200);
enigo.mouse_move_relative(100, 100);
enigo.key_sequence("hello world");


  • DSL parser module


  • The main struct for handling the event emitting



  • Contains functions to simulate key presses and to input text.
  • Contains functions to control the mouse and to get the size of the display. Enigo uses a Cartesian coordinate system for specifying coordinates. The origin in this system is located in the top-left corner of the current screen, with positive values extending along the axes down and to the right of the origin point and it is measured in pixels. The same coordinate system is used on all operating systems.