Sixaxis emulator: keyboard macros

It’s now possible to configure keyboard macros.

A key press will generate a series of events, with timing conditions.

Commands are the following:
– key down
– key up
– key press (= key down + delay + key up)
– delay (unit = ms)

Each macro has to be defined in a file.

Example: macro_example.txt

#Defines the action that triggers the macro execution
MACRO F1
#Performs a keystroke (key down + delay 50ms + key up)
KEY e
#Sleep 50ms
DELAY 50
#Perform a key down
KEYDOWN SPACE
#Sleep 50ms (minimum delay between KEYDOWN and KEYUP)
DELAY 50
#Perform a key up
KEYUP SPACE

Lines beginning with # are comments.

Each macro file has to be referenced in the macros.txt file.

All keys of the keyboard can trigger a macro. The complete list can be found in macro.c.

Remaining work:
– support for mouse events (buttons + moves)
– record/replay functionnality