SyntheticInput

Allows for sending synthetic input to the X server via the Xtst extension or on Windows using SendInput.

Please remember user input is meant to be user - don't use this if you have some other alternative!

Constructors

this
this(int dummy)

The dummy param must be 0.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

A postblit is present on this object, but not explicitly documented in the source.

Members

Functions

pressKey
void pressKey(Key key, bool pressed, int delay)

Sends a fake press or release key event.

pressMouseButton
void pressMouseButton(MouseButton button, bool pressed, int delay)

Sends a fake mouse button press or release event.

sendSyntheticInput
void sendSyntheticInput(string s)

Simulates typing a string into the keyboard.

Static functions

moveMouseArrowBy
void moveMouseArrowBy(int dx, int dy)
moveMouseArrowTo
void moveMouseArrowTo(int x, int y)

Bugs

All methods on OSX Cocoa will throw not yet implemented exceptions.

Meta

History

Added May 17, 2020 with the X implementation.

Added unified implementation for Windows on April 3, 2022. (Prior to that, you had to use the top-level sendSyntheticInput or the Windows SendInput call directly.)