DocsReferenceAPI reference

HID keyboard and mouse

Send keyboard, mouse and media input to the connected computer over Wi-Fi: arm first (a lease), then send actions or a timeline; the BOOT button and disarm stop it at any time. Also timelines on the microSD card, the monitor screen and the USB mode

GET /v1/hid#

HID state: lease left, queue, held keys, LEDs (Num / Caps / Scroll)

Signature required Kernel only

Read-only; changes nothing. To wait for a batch, sleep until its planned end, then check that done_seq is at least the batch's seq

Reply#

HID state

Overall state of HID output

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
usbstringYeshid serialUSB mode (POST /v1/usb)
mountedbooleanYesThe computer has enumerated the device (plugged in, awake; always false in serial mode)
armedbooleanYesThe network source is armed
armed_left_sintegerYes≥ 0Seconds left on the lease; 0 when disarmed
app_allowedbooleanYesThe app source is open (the running app has the hid permission)
app_pausedbooleanYesAn emergency stop paused the app source; a press of BOOT resumes it
activebooleanYesOutput in progress (turns false 300 ms after the queue empties)
queueintegerYes≥ 0Items waiting in the queue
queue_maxintegerYes≥ 0Queue capacity
sentintegerYes≥ 0Items executed since boot (text counts per character)
last_seqintegerYes≥ 0Sequence number of the most recently queued batch
done_seqintegerYes≥ 0Every batch with seq up to this is finished or dropped
ledsobjectYesKeyboard LEDs set by the computer
numbooleanYesNum Lock
capsbooleanYesCaps Lock
scrollbooleanYesScroll Lock
heldobjectYesWhat the computer currently sees held
keysinteger[]Yeseach 0–255Held keys (usage codes, modifiers 0xE0–0xE7 included; see x-codes of KeyName)
buttonsintegerYes0–31Held mouse button bits (see x-bits of MouseButton)
consumerintegerYes0–1023Held consumer usage code, 0 = none
batchobject | nullYesBatch being executed; null when idle
seqintegerYes≥ 0Batch sequence number
tagstring | nullYesBatch tag; null if none
started_msintegerYes≥ 0Device uptime in ms when it started
doneintegerYes≥ 0Items executed
countintegerYes≥ 0Items in the batch
stoppedobject | nullYesThe most recent stop; null if none
whystringYesboot host lease usbboot = BOOT emergency stop, host = host disarm, lease = lease expired, usb = USB disconnected
msintegerYes≥ 0Device uptime in ms when it stopped

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/hid#

Send keyboard and mouse actions (keys go to the foreground window)

Signature required Kernel only Sends input

Queues a batch of actions and replies at once, without waiting for execution. Frames are at least 8 ms apart: tap, click and media take two frames each (press, release), text two per character. The whole batch is checked first; if one action is invalid the reply is 400 bad_action and nothing is sent. Arm first with POST /v1/hid/arm. This format is frozen and gets no new actions: new features go into timelines (POST /v1/hid/timeline), and host tools convert actions with stick.hidtl.from_actions

Request body#

application/json

A batch of actions. Only actions and tag are accepted at the top level; the former wait was removed (sending it returns 400 bad_args). To wait for completion, check done_seq in GET /v1/hid

FieldTypeRequiredValuesRangeDescription
actionsobject[]Yes1–512 itemsActions, executed in order, 1–512. The whole batch is checked first: if one is invalid, none is queued
Tap a keyobjectPress and release (two frames). With mods, the modifiers apply to the press: write a shortcut as {"tap":"A","mods":["alt"]}
tapstringYesStandard 87-key set / Extended keysKey name
modsstring[]Modifier nameModifiers pressed together with this key, e.g. ["ctrl","shift"]
Hold a keyobjectPress without releasing; release later with up. At most 6 non-modifier keys can be held at once; extra ones are ignored
downstringYesStandard 87-key set / Extended keysKey name
modsstring[]Modifier nameModifiers pressed together with this key, e.g. ["ctrl","shift"]
Release a keyobjectRelease one key; "all" releases every key
upstringYesStandard 87-key set / Extended keys / all; case-insensitiveKey name, or all
Type textobjectTypes character by character with the US layout: one press frame and one release frame per character, adding Shift where needed. Counts one queue item per character
textstringYespattern ^[ -~\t\n]+$length 1–256Text to type: printable ASCII plus \n and \t, US layout, 1–256 characters. Non-ASCII text (such as Chinese) cannot be typed
Move the mouseobjectRelative move [dx, dy]; right and down are positive
moveinteger[]Yes2 items; each -2000 – 2000[dx, dy]
Click a mouse buttonobjectPress and release
clickstringYesMouse buttonMouse button
Press a mouse buttonobjectPress without releasing (for dragging); release later with release
pressstringYesMouse buttonMouse button
Release a mouse buttonobjectRelease a held mouse button
releasestringYesMouse buttonMouse button
Vertical wheelobjectPositive scrolls up, negative scrolls down
wheelintegerYes-127 – 127Wheel steps, ±127
Horizontal wheelobjectPositive scrolls right, negative scrolls left
hwheelintegerYes-127 – 127Wheel steps, ±127
Media keyobjectClick a media key once (press and release)
mediastringYesMedia key nameMedia key name
PauseobjectWait some milliseconds before the next action (sends nothing)
waitintegerYes0–5000Pause in milliseconds, 0–5000
tagstringpattern ^[A-Za-z0-9_.:-]{1,32}$length 1–32Batch tag: 1–32 of A-Z a-z 0-9 _ . : -. For matching only (batch in GET /v1/hid, the source on the monitor screen); does not affect execution

Examples#

Shortcut Alt+A#

A shortcut is tap plus mods, not {"key":"alt+a"}

JSON
{"actions": [{"tap": "A", "mods": ["alt"]}]}

Copy, then paste#

JSON
{
  "actions": [{"tap": "C", "mods": ["ctrl"]}, {"tap": "V", "mods": ["ctrl"]}]
}

Type text#

\n is Enter; ASCII only

JSON
{"actions": [{"text": "Hello, Keyling!\n"}]}

Hold and release#

Hold left Shift, press Right three times to select three characters, then release

JSON
{
  "actions": [
    {"down": "LSHIFT"},
    {"tap": "RIGHT"},
    {"tap": "RIGHT"},
    {"tap": "RIGHT"},
    {"up": "LSHIFT"}
  ]
}

Release all keys#

JSON
{"actions": [{"up": "all"}]}

Move the mouse and click#

Right 120, up 40, then a left click

JSON
{"actions": [{"move": [120, -40]}, {"click": "left"}]}

Drag#

Hold the left button, move right 200, then release

JSON
{"actions": [{"press": "left"}, {"move": [200, 0]}, {"release": "left"}]}

Scroll#

Scroll down 3 steps, then right 2 steps

JSON
{"actions": [{"wheel": -3}, {"hwheel": 2}]}

Media keys#

Volume up twice

JSON
{"actions": [{"media": "volume_up"}, {"media": "volume_up"}]}

Pause#

Win+R opens Run, wait 0.5 s for the dialog, then type notepad and Enter; tag is for matching

JSON
{
  "actions": [{"tap": "R", "mods": ["gui"]}, {"wait": 500}, {"text": "notepad\n"}],
  "tag": "open-notepad"
}

Reply#

Queued

The whole batch is queued (not yet executed)

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
seqintegerYes≥ 0Batch sequence number; the batch is finished (or dropped) once done_seq in GET /v1/hid is at least this
queuedintegerYes≥ 0Queue items taken (text counts per character, timelines per record)

Error codes#

StatusCodeDescription
400bad_actionThe body is not {"actions":[...]}, actions is empty, or an action is wrong (message names which one and why). Each action takes exactly one form: write a shortcut as {"tap":"A","mods":["alt"]}, not {"key":"alt+a"}. Nothing was queued; fix it and resend. See the example “Shortcut Alt+A” for the correct form
400bad_argswait was given (removed: check done_seq in GET /v1/hid to wait for completion), or tag is not 1–32 of A-Z a-z 0-9 _ . : -
403hid_lockedNot armed, or the lease expired: POST /v1/hid/arm first
503not_mountedThe computer has not enumerated the device (unplugged, asleep, or USB mode is serial). Plug it in, or switch back with POST /v1/usb hid
429queue_fullMore than 512 actions at once, or the queue cannot fit the batch (4096 items, text counts per character). Send in batches or wait for done_seq to catch up; use a timeline for long sequences

For errors any endpoint can return, see Common errors.

POST /v1/hid/arm#

Arm HID output (lease; disarms and releases all keys on expiry). Call again to renew

Signature required Kernel only Sends input

Output from the network source (host, web app, agent) must be armed first. The lease lasts seconds (1–600, default 60); calling again renews it and replaces the time left. On expiry the device disarms: it drops queued network-source items, releases all keys, and GET /v1/hid reports stopped.why = lease. Hosts running long sequences renew the lease themselves; if the host crashes or loses the network, the device stops and releases within one lease

Request body#

application/json · optional

The body is optional (defaults to 60 s)

FieldTypeRequiredValuesRangeDescription
secondsintegerdefault 601–600Lease in seconds, 1–600

Examples#

Arm for 60 s#

JSON
{"seconds": 60}

Renew to 300 s#

Calling while armed renews: the time left becomes 300 s

JSON
{"seconds": 300}

Omit seconds (60 s)#

JSON
{}

Reply#

Armed

The lease started or was renewed

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
armed_left_sintegerYes1–600Seconds left on the lease

Error codes#

StatusCodeDescription
400bad_secondsseconds is not an integer in 1–600, or the body is not a JSON object. Use {"seconds":60}. See the example “Arm for 60 s” for the correct form

For errors any endpoint can return, see Common errors.

POST /v1/hid/disarm#

Emergency stop and disarm

Signature required Kernel only

Emergency stop: clears the queue (network and app sources), releases all keys and mouse buttons, disarms, and pauses the app source (a press of BOOT or restarting the app resumes it). stopped.why = host. Takes effect at once without waiting for the queue (about 20 ms measured). Calling it while idle is a normal wrap-up; the screen shows no stop panel

Reply#

Stopped and disarmed

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/hid/timeline#

Timeline (6-byte records, executed at their scheduled times)

Signature required Kernel only Sends input

The only execution format; new features go here only. The upper layer decides what to send in each frame and when; the device executes frames on their scheduled times: a record runs at the previous record's scheduled time plus dt, at least 4 ms after the previous frame; when more than 20 ms behind schedule it re-schedules from now instead of bursting to catch up. A batch is 1–4096 records, read whole and checked record by record; it is queued only if all are valid. Release the keys you press (or end with release_all). Signing is as usual; X-Stick-Sha256 is the hash of the binary body. Host: stick.hidtl.encode / from_actions, stick hid-play

Parameters#

ParameterTypeRequiredValuesRangeDescription
tagstringpattern ^[A-Za-z0-9_.:-]{1,32}$length 1–32Batch tag

Request body#

application/octet-stream

Timeline: 6-byte records back to back, no header, 1–4096 records. Each is little-endian u16 dt, u8 op, u8 a, i8 b, i8 c: dt is milliseconds after the previous record (0–5000), op is listed in x-ops, and unused fields must be 0. Frames are at least 4 ms apart (the device delays shorter gaps)

Op codes

OpCodeDescription
nop0Sends nothing; only takes time (dt). a b c are 0
key_down1Key down: a = keyboard usage code (x-codes of KeyName, modifiers 0xE0–0xE7 included), b = modifier bits (read as u8, x-bits of ModName)
key_up2Key up: a = usage code, 0 releases all keys
move3Relative mouse move: b = dx, c = dy (±127)
btn_down4Mouse button down: a = button bits (1–0x1F, x-bits of MouseButton)
btn_up5Mouse button up: a = button bits
wheel6Wheel: b = vertical (positive scrolls up), c = horizontal (positive scrolls right), ±127
release_all7Release all keys, mouse buttons and media keys (one keyboard, mouse and consumer frame each; takes 8 ms)
consumer8Media key: a = low 8 bits, b (read as u8) = high 8 bits of the consumer usage code 0–0x3FF (x-codes of MediaName); 0 releases. Held until the next consumer record
abs_x9Absolute pointer X: a = low 8 bits, b (read as u8) = high 8 bits, 0–32767; sends nothing until the next moveto
moveto10Absolute pointer Y (encoded like abs_x); sends one frame moving to (X, Y). 0–32767 spans the primary display

Examples#

Shortcut Alt+A#

Press A (modifier bits 0x04 = alt), release 30 ms later

HEX
000001040400 1e0002040000
dtopabc
0key_down440
30key_up400

Click the center of the primary display#

X and Y are both 16384 (0x4000); left button bit 1

HEX
000009004000 00000a004000 140004010000 280005010000
dtopabc
0abs_x0640
0moveto0640
20btn_down100
40btn_up100

Media key#

Volume up (consumer 0xE9), released 30 ms later

HEX
000008e90000 1e0008000000
dtopabc
0consumer23300
30consumer000

Release everything#

Releases all keys, mouse buttons and media keys (what stick hid-release sends)

HEX
000007000000
dtopabc
0release_all000

Reply#

Queued

The whole batch is queued (not yet executed)

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
seqintegerYes≥ 0Batch sequence number; the batch is finished (or dropped) once done_seq in GET /v1/hid is at least this
queuedintegerYes≥ 0Queue items taken (text counts per character, timelines per record)

Error codes#

StatusCodeDescription
400bad_actionThe body length is 0 or not a multiple of 6, or a record is invalid (message gives the record number and reason). Nothing was queued; check on the host with stick.hidtl.check. See the example “Shortcut Alt+A” for the correct form
400bad_argswait was given (removed: check done_seq in GET /v1/hid to wait for completion), or tag is not 1–32 of A-Z a-z 0-9 _ . : -
413too_largeMore than 4096 records (24576 bytes). Send in batches, or put it on the microSD card and use POST /v1/hid/play_file
403hid_lockedNot armed, or the lease expired: POST /v1/hid/arm first
503not_mountedThe computer has not enumerated the device (unplugged, asleep, or USB mode is serial). Plug it in, or switch back with POST /v1/usb hid
429queue_fullThe queue cannot fit the batch (4096 items). Wait for done_seq to catch up

For errors any endpoint can return, see Common errors.

POST /v1/hid/play_file#

Stream a timeline file from the microSD card

Signature required Kernel only Sends input

Streams a timeline file from the microSD card; suited to large macros. The file holds the same records as the POST /v1/hid/timeline body (no header), from 1 record to 16 MB. The whole file is validated first (if that takes over 1 s the reply is state=checking; poll GET until playing or stopped), then fed to the queue in batches. Arm first and keep renewing the lease for long files. One file plays at a time

Request body#

application/json

Path of the timeline file on the card and the batch tag

FieldTypeRequiredValuesRangeDescription
pathstringYespattern ^/length 2–160; ≤ 160 bytesFile path on the card, starting with / from the card root, ≤ 160 bytes, same rules as /v1/sd, e.g. /stick/macros/a.tl
tagstring | nullpattern ^[A-Za-z0-9_.:-]{1,32}$Batch tag; sdplay when omitted or null

Examples#

Play a file#

JSON
{"path": "/stick/macros/a.tl"}

With a batch tag#

tag shows on the monitor screen and in batch of GET /v1/hid

JSON
{"path": "/stick/macros/a.tl", "tag": "nightly"}

Reply#

Playing, or still validating

Validated and feeding, or a large file is still being checked

FieldTypeRequiredValuesRangeDescription
PlayingobjectThe whole file passed validation and is being fed to the queue
okbooleanYestrueAlways true
recordsintegerYes≥ 0Number of records
duration_msintegerYes≥ 0Estimated duration in ms
CheckingobjectReturned when validation takes over 1 s; poll GET /v1/hid/play_file until it becomes playing or stopped
okbooleanYestrueAlways true
statestringYescheckingValidating the whole file
recordsintegerYes≥ 0Number of records

Error codes#

StatusCodeDescription
400bad_argspath is missing, or tag is invalid. Write {"path":"/stick/macros/a.tl"}. See the example “Play a file” for the correct form
400bad_pathInvalid path: it must start with /, be ≤ 160 bytes, and contain no .. // \ : * ? " < > | or control characters. See the example “Play a file” for the correct form
404not_foundNo such file on the card. Upload it with stick sd put
409is_dirThis is a folder; give a file path
400bad_actionThe file is empty, not a multiple of 6 bytes, over 16 MB, or has an invalid record (message says why)
409busyAnother file is playing. POST /v1/hid/play_file/stop first
403hid_lockedNot armed, or the lease expired: POST /v1/hid/arm first
503not_mountedThe computer has not enumerated the device (unplugged, asleep, or USB mode is serial). Plug it in, or switch back with POST /v1/usb hid
503no_cardNo card, or the card cannot be mounted (not FAT)
503sd_busyThe card is busy with another request. Try again later
503no_memThe playback task did not start (out of memory). Restart the device

For errors any endpoint can return, see Common errors.

GET /v1/hid/play_file#

Playback state of the card timeline

Signature required Kernel only

Progress and outcome of the most recent playback. state is done when finished, or stopped with why when it stopped part way

Reply#

Playback state

State of the most recent playback

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
statestringYesidle checking playing done stoppedidle = nothing played since boot, checking = validating the file, playing, done = finished, stopped = stopped part way
pathstring | nullYesPath on the card
srcstring | nullYesnet app nullWho started it: net = host, app = an app
tagstring | nullYesBatch tag
recordsintegerYes≥ 0Number of records
sentintegerYes≥ 0Records handed to the HID queue
doneintegerYes≥ 0Records executed (counted per batch, at most one batch behind)
duration_msintegerYes≥ 0Estimated duration in ms
elapsed_msintegerYes≥ 0Milliseconds since feeding started
whystring | nullYesstop flushed locked not_mounted sd_read file_changed bad_action nullWhy it stopped: stop = host stop, flushed = queue cleared by an emergency stop or lease expiry, locked = output gate closed, not_mounted = computer disconnected, sd_read = card read error, file_changed = file modified, bad_action = invalid record
messagestring | nullYesDetail; for bad_action, the record number and reason

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/hid/play_file/stop#

Stop playback

Signature required Kernel only

Stops playback: drops what has not run and releases everything, without disarming (the lease continues). Succeeds even when nothing is playing

Reply#

Stopped

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

For errors any endpoint can return, see Common errors.

GET /v1/monitor#

Monitor screen state (right side: name, mode, step, progress)

Signature required Kernel only

Whether the monitor screen is shown, who set the status on its right side, and how long it has left

Reply#

Monitor screen state

Whether the monitor screen is shown and its status

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
visiblebooleanYesThe monitor screen is shown
ownerstring | nullYesapp host nullWho set the status: app (monitor.set) or host; null when unset
ttl_sinteger | nullYes≥ 1Seconds left on a host-set status; null for app-set or unset
statusobjectYesCurrent status; null when unset
Monitor screen statusobjectWhat the right side of the monitor screen shows
namestringYesName on the left of the status bar; device ID when empty
modestringYesMode in the pill, e.g. once or LOOP
sourcestringYesSource to the right of the pill
titlestringYesLarge title; follows state when empty
line1stringYesFirst line
line2stringYesSecond line (below the progress bar)
statestringYesready running stopped errorState: ready, running, stopped, error
progressinteger | nullYes0–100Progress 0–100; null hides the bar
#2null

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/monitor#

Set the monitor screen state (replaces it)

Signature required Kernel only

Sets the status on the right side of the monitor screen (replaces it; every field is optional). A host-set status carries ttl_s (default 60 s) and clears itself on expiry; between this and an app's monitor.set, the later one wins. {"clear":true} clears it. Only changes the screen; sends no input

Request body#

application/json

Replaces the whole status; every field is optional. {"clear":true} clears it. Lengths are UTF-8 bytes

FieldTypeRequiredValuesRangeDescription
namestring≤ 48 bytesStatus bar name, ≤ 48 bytes
modestring≤ 12 bytesMode in the pill, ≤ 12 bytes
sourcestring≤ 24 bytesSource, ≤ 24 bytes
titlestring≤ 48 bytesLarge title, ≤ 48 bytes; follows state when omitted
line1string≤ 48 bytesFirst line, ≤ 48 bytes
line2string≤ 48 bytesSecond line, ≤ 48 bytes
statestringready running stopped error; default runningState, running when omitted; stopped / error keep the stop panel shown
progressnumber | null0–100Progress 0–100 (rounded); null or omitted hides the bar
ttl_sintegerdefault 601–3600Seconds until it clears itself, 1–3600
clearbooleantrue clears it (whoever set it); other fields are ignored

Examples#

Running#

A one-off task at step 3, 43% done, clearing itself after 120 s. Chinese values: 填单 = fill in a form, 单次 = once, 第 3 步 / 共 7 步 = step 3 of 7

JSON
{
  "name": "填单",
  "mode": "单次",
  "source": "Agent",
  "state": "running",
  "line1": "第 3 步 / 共 7 步",
  "progress": 43,
  "ttl_s": 120
}

Error#

An error keeps the stop panel shown, with line1 / line2 below it. Chinese values: 找不到保存按钮 = Save button not found, 单击 BOOT 重试 = click BOOT to retry

JSON
{"name": "填单", "state": "error", "line1": "找不到保存按钮", "line2": "单击 BOOT 重试"}

Clear#

JSON
{"clear": true}

Reply#

Set

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

StatusCodeDescription
400bad_argsUnknown field, wrong type, too long or out of range (message says which). See the example “Running” for the correct form
400bad_jsonThe body is not a JSON object. See the example “Running” for the correct form

For errors any endpoint can return, see Common errors.

POST /v1/usb#

USB mode hid / serial; restarts after replying (no keyboard or mouse in serial)

Signature required Kernel only Restarts

Saves the USB mode and restarts about 0.5 s after replying. hid (default): keyboard, mouse, media keys and absolute pointer, with no USB serial; serial: no HID, keeps the USB serial console for debugging. The rescue firmware always uses serial

Request body#

application/json

USB mode to switch to

FieldTypeRequiredValuesRangeDescription
modestringYeshid serialhid = keyboard and mouse (default), serial = USB serial console (no HID)

Examples#

Keyboard and mouse#

JSON
{"mode": "hid"}

USB serial#

After the restart there is no keyboard or mouse; switch back over Wi-Fi

JSON
{"mode": "serial"}

Reply#

Saved; restarting

Saved; restarts about 0.5 s after replying

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
usbstringYeshid serialUSB mode after the restart

Error codes#

StatusCodeDescription
400bad_modemode must be hid or serial. See the example “Keyboard and mouse” for the correct form
500nvsSaving failed. Retry; if it persists, check stick logs

For errors any endpoint can return, see Common errors.

Name tables#

Standard 87-key set KeyName87#

Standard 87-key set (TKL: main block, F1–F12, PrtSc / ScrLk / Pause, 6 editing keys, arrows, 8 modifiers and Menu). Host tools and the SDK accept only these by default. Case-insensitive; the canonical spelling is listed. x-codes are USB keyboard usage codes (field a of timeline key_down / key_up)

  • A0x04
  • B0x05
  • C0x06
  • D0x07
  • E0x08
  • F0x09
  • G0x0A
  • H0x0B
  • I0x0C
  • J0x0D
  • K0x0E
  • L0x0F
  • M0x10
  • N0x11
  • O0x12
  • P0x13
  • Q0x14
  • R0x15
  • S0x16
  • T0x17
  • U0x18
  • V0x19
  • W0x1A
  • X0x1B
  • Y0x1C
  • Z0x1D
  • 10x1E
  • 20x1F
  • 30x20
  • 40x21
  • 50x22
  • 60x23
  • 70x24
  • 80x25
  • 90x26
  • 00x27
  • ENTER0x28
  • ESC0x29
  • BACKSPACE0x2A
  • TAB0x2B
  • SPACE0x2C
  • MINUS0x2D
  • EQUAL0x2E
  • LBRACKET0x2F
  • RBRACKET0x30
  • BACKSLASH0x31
  • SEMICOLON0x33
  • QUOTE0x34
  • GRAVE0x35
  • COMMA0x36
  • PERIOD0x37
  • SLASH0x38
  • CAPSLOCK0x39
  • F10x3A
  • F20x3B
  • F30x3C
  • F40x3D
  • F50x3E
  • F60x3F
  • F70x40
  • F80x41
  • F90x42
  • F100x43
  • F110x44
  • F120x45
  • PRINTSCREEN0x46
  • SCROLLLOCK0x47
  • PAUSE0x48
  • INSERT0x49
  • HOME0x4A
  • PGUP0x4B
  • DELETE0x4C
  • END0x4D
  • PGDN0x4E
  • RIGHT0x4F
  • LEFT0x50
  • DOWN0x51
  • UP0x52
  • MENU0x65
  • LCTRL0xE0
  • LSHIFT0xE1
  • LALT0xE2
  • LGUI0xE3
  • RCTRL0xE4
  • RSHIFT0xE5
  • RALT0xE6
  • RGUI0xE7

The number after each name is its usage code (hex).

Extended keys KeyNameExtended#

Extended keys: the device accepts them, but foreground programs usually ignore them; for self-tests and drills only. Host tools need --extended / extended=True and SDK plans need "keyset": "full"; the device and timelines make no distinction

NameUsage code
NUMLOCK0x53 (83)
F130x68 (104)
F140x69 (105)
F150x6A (106)
F160x6B (107)
F170x6C (108)
F180x6D (109)
F190x6E (110)
F200x6F (111)
F210x70 (112)
F220x71 (113)
F230x72 (114)
F240x73 (115)

Modifier name ModName#

Modifier name: ctrl shift alt gui are the left ones (gui = Windows / Command key), the r-prefixed ones are on the right. Case-insensitive; x-bits are modifier bits (field b of timeline key_down)

NameBit
ctrl0x01 (1)
shift0x02 (2)
alt0x04 (4)
gui0x08 (8)
rctrl0x10 (16)
rshift0x20 (32)
ralt0x40 (64)
rgui0x80 (128)

Mouse button MouseButton#

Mouse button

NameBit
left0x01 (1)
right0x02 (2)
middle0x04 (4)
back0x08 (8)
forward0x10 (16)

Media key name MediaName#

Media key name

NameUsage code
volume_up0xE9 (233)
volume_down0xEA (234)
mute0xE2 (226)
play_pause0xCD (205)
next0xB5 (181)
prev0xB6 (182)
stop0xB7 (183)
brightness_up0x6F (111)
brightness_down0x70 (112)

View the source of this page on GitHub