Skip to content

ZeroTrace HID

Gamepad Commands

Emulate a USB gamepad — buttons, sticks, triggers, D‑pad, and automated input patterns

Gamepad commands emulate a standard controller over USB‑HID only (there is no BLE gamepad). Stick and trigger values are 8‑bit signed: -128127.

How arguments work

Every argument is expanded first, so ${var}$ and operators like _$random(...) work anywhere. Argument counts are matched exactly — a command given the wrong number of arguments is silently skipped. Button names are case‑insensitive; an unknown name is a no‑op.

Buttons and combos

Presses and holds a button. See the button reference below.

pressButton 'A'
pressButton 'TL'

Sticks and triggers

Sets the left stick position. Both axes are 8‑bit signed (-128127).

leftStick 100 0
leftStick 0 -100
leftStick 0 0

D‑pad (hat)

Sets the D‑pad (hat) position. See the hat reference below.

hat 'UP_LEFT'
hat 'CENTER'

Reset

reset centers both sticks, zeros the triggers, releases every button, and returns the hat to CENTER.

reset

Reference tables

Buttons

Case‑insensitive. The number is the HID button index.

NameIndexAliases
A0SOUTH
B1EAST
C2
X3NORTH
Y4WEST
Z5
TL6
TR7
TL28
TR29
SELECT10
START11
MODE12
THUMBL13
THUMBR14

Hat positions

NameIndex
CENTER0
UP1
UP_RIGHT2
RIGHT3
DOWN_RIGHT4
DOWN5
DOWN_LEFT6
LEFT7
UP_LEFT8
Tricks
  • comboPress uses commas ('A,B'); the keyboard's comboKey uses +. Mixing them up silently does the wrong thing.
  • comboRelease and reset both clear all held buttons — comboRelease ignores any argument you give it.
  • The SOUTH/EAST/NORTH/WEST aliases map to A/B/X/Y respectively — handy for layout‑agnostic payloads.
  • Always give sweepSticks a non‑zero steps.

Command Palette

Search for a command to run...