Gamepad Commands
Emulate a USB gamepad — buttons, sticks, triggers, D‑pad, and automated input patterns
Na tej stronie
Gamepad commands emulate a standard controller over USB‑HID only (there is no BLE gamepad). Stick and trigger values are 8‑bit signed: -128–127.
Buttons and combos
Presses and holds a button. See the button reference below.
pressButton 'A'
pressButton 'TL'Releases a single held button.
releaseButton 'B'Presses a button, waits delayMs, then releases it.
tapButton 'X' 200Presses several buttons at once. Names are joined with commas (unlike the keyboard's comboKey, which uses +).
comboPress 'A,B'
comboPress 'TL,TR'Releases all currently pressed buttons. It takes no arguments — there is no selective release. This is equivalent to reset for buttons.
comboPress 'X,Y'
delay 1000
comboReleaseTaps a button times times, waiting intervalMs between taps.
rapidFire 'A' 10 100Sticks and triggers
Sets the left stick position. Both axes are 8‑bit signed (-128–127).
leftStick 100 0
leftStick 0 -100
leftStick 0 0Sets the right stick position (z/rz axes), 8‑bit signed each.
rightStick -50 50Sets the left analog trigger (rx) value, 8‑bit signed.
leftTrigger 127
leftTrigger -128Sets the right analog trigger (ry) value, 8‑bit signed.
rightTrigger 64
rightTrigger -64Moves both sticks in a circular sweep of amplitude, over steps steps, pausing delayMs between steps.
sweepSticks 100 36 50D‑pad (hat)
Sets the D‑pad (hat) position. See the hat reference below.
hat 'UP_LEFT'
hat 'CENTER'Presses a hat direction, waits delayMs, then returns to CENTER.
tapDpad 'UP' 300Reset
reset centers both sticks, zeros the triggers, releases every button, and returns the hat to CENTER.
resetReference tables
Buttons
Case‑insensitive. The number is the HID button index.
| Name | Index | Aliases |
|---|---|---|
A | 0 | SOUTH |
B | 1 | EAST |
C | 2 | — |
X | 3 | NORTH |
Y | 4 | WEST |
Z | 5 | — |
TL | 6 | — |
TR | 7 | — |
TL2 | 8 | — |
TR2 | 9 | — |
SELECT | 10 | — |
START | 11 | — |
MODE | 12 | — |
THUMBL | 13 | — |
THUMBR | 14 | — |
Hat positions
| Name | Index |
|---|---|
CENTER | 0 |
UP | 1 |
UP_RIGHT | 2 |
RIGHT | 3 |
DOWN_RIGHT | 4 |
DOWN | 5 |
DOWN_LEFT | 6 |
LEFT | 7 |
UP_LEFT | 8 |