AXedocs
Install

Keyboard & Text Input

Type text, press individual HID keycodes, run key sequences, and send atomic modifier combos.

AXe drives keyboard input through raw HID keycodes. That is deterministic, but it means text entry is limited to the US keyboard layout.

Text input#

type accepts exactly one input source: positional text, --stdin, or --file.

shell
axe type 'Hello, world!' --udid <UDID>
echo 'Multi-line text' | axe type --stdin --udid <UDID>
axe type --file message.txt --udid <UDID>

Supported text includes ASCII letters, digits, common US-keyboard symbols, spaces, and newlines. Accented and non-ASCII characters fail with unsupportedCharacter.

Single keys#

shell
axe key 40 --udid <UDID>
axe key 42 --duration 1.0 --udid <UDID>

keycode must be 0–255. --duration must be greater than 0 and at most 10 seconds.

Key sequences#

shell
axe key-sequence --keycodes 11,8,15,15,18 --udid <UDID>
axe key-sequence --keycodes 40,40,40 --delay 0.5 --udid <UDID>

--keycodes is a comma-separated list of up to 100 codes. --delay defaults to 0.1 seconds and must be 0–5 seconds.

Key combos#

key-combo holds modifiers in order, presses one target key, then releases modifiers in reverse order.

shell
axe key-combo --modifiers 227 --key 4 --udid <UDID>       # Cmd+A
axe key-combo --modifiers 227 --key 6 --udid <UDID>       # Cmd+C
axe key-combo --modifiers 227 --key 25 --udid <UDID>      # Cmd+V
axe key-combo --modifiers 227,225 --key 4 --udid <UDID>   # Cmd+Shift+A

A combo can hold 1–8 modifiers.

Common keycodes#

KeyCode
a4
c6
v25
Return / Enter40
Escape41
Backspace42
Tab43
Space44
Left Control224
Left Shift225
Left Option226
Left Command227
Right Control228
Right Shift229
Right Option230
Right Command231