Crate enigo [] [src]

Enigo lets you simulate mouse and keyboard input-events as if they were made by the actual hardware. The goal is to make it available on different operating systems like Linux, macOS and Windows – possible many more but Redox and *BSD are planned. Please see the Repo for the current status.

I consider this library in an early alpha status, the API will change in in the future. The keyboard handling is far from being very usable. I plan to build a simple DSL that will resemble something like:

"hello {+SHIFT}world{-SHIFT} and break line{ENTER}"

Possible use cases could be for testing user interfaces on different plattforms, building remote control applications or just automating tasks for user interfaces unaccessible by a public API or scripting laguage.

Examples

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

Structs

Enigo

The main struct for handling the event emitting

Traits

KeyboardControllable

Representing an interface and a set of keyboard functions every operating system implementation should implement.

MouseControllable

Representing an interface and a set of mouse functions every operating system implementation should implement.