Click n' Replay is a tool that enables developers to simulate mouse and keyboard events. For Windows only, requires the .NET 4 redistributable package.
Overview of the features:
The source code and the binaries are available on BitBucket under the licence Creative Commons Attribution 4.0 International (CC BY 4.0) : https://bitbucket.org/bbillet/clicknreplay
The code uses a modified version of the UserActivityHook, which is distributed under the Code Project Open License (CPOL) 1.02.
Note: Shortcut keys can be used anywhere at any time.
CLICKDOWN x y <left|middle|right>
Simulate a “Mouse button pressed” event. Default: left button.
CLICKUP x y <left|middle|right>
Simulate a “Mouse button released” event. Default: left button.
CLICK x y <left|middle|right>
Simulate a “Click” event (mouse button pressed and then relased). Default: left button.
MOUSEMOVE x y <absolute|relative>
Simulate a mouse move. If “absolute”, the cursor is moved to the point x,y. If “relative”, the cursor is moved of x and y pixels from its original position. Default: absolute.
PAUSE milliseconds
Make a pause.
TYPE text
Simulate text typing (equivalent to a sequence of KEY commands). In loop mode, the sequence [LOOP_COUNTER] is automatically replaced by the current number of loop.
KEYDOWN keyCode
Simulate a “Key pressed” event. The keyCode can be decimal or hexadecimal (begin with 0x). See the Virtual-Key Code Table.
KEYUP keyCode
Simulate a “Key released” event. The keyCode can be decimal or hexadecimal (begin with 0x). See the Virtual-Key Code Table.
KEY keyCode
Simulate a “Keystroke” event (key pressed and then released). The keyCode can be decimal or hexadecimal (begin with 0x). See the Virtual-Key Code Table.
FOREGROUND processName
Find a process by its name and bring it to foreground.
The recording tool has some limitations and can only record typing events and clicks. Other instructions must be written manually into the script.
I plan to improve this part in the future.
Event simulation does not work well inside desktop virtual machine with mouse sharing enabled (tested with VirtualBox).