Input
| Button | Keys |
|---|---|
up / down / left / right | arrows, WASD |
a | J, Z, Space, Enter |
b | K, X |
x | U |
y | I |
repeat(key, delay = 0.3, interval = 0.1), seconds. A tap between ticks still counts once in pressed.
On-screen controls
directions shows the pad. buttons lists a / b / x / y. Omit to show all. buttons: [] hides buttons, controls: false hides everything. Keyboard input is unaffected.
Standalone HTML
The third argument names the input source; releasing one source keeps another held.
Controller patterns
controls: {pattern: 'single'} shows a large J button in the bottom center without a directional pad. pattern: 'standard' uses the standard layout. A single-button layout can select a different action with buttons: ['b']; it requires exactly one button. Both sample pages and shared games use the declared pattern.