Game controllers
AnyPS5 accepts any controller that SDL has a mapping for. Xbox-style pads and PlayStation controllers recognised by SDL use the standard PlayStation button layout, with analog sticks and triggers passed through.
| Xbox-layout controller | Seen by the title as |
|---|---|
| A / B / X / Y | Cross / Circle / Square / Triangle |
| LB / RB | L1 / R1 |
| LT / RT | L2 / R2 (analog) |
| Start | Options |
| D-pad, stick clicks | D-pad, L3 / R3 |
- Controllers can be connected or unplugged while the game is running.
- The first recognised controller is the one that is used.
- On a PlayStation controller the touchpad click is forwarded. Finger positions on the touchpad are not implemented.
- Controller bindings are always on and are not affected by the keyboard and mouse file.
Keyboard and mouse
With no configuration file, AnyPS5 uses its built-in keyboard and mouse bindings. To change some of them, create a file named
anyps5-input.ini beside the generated executable, or point ANYPS5_INPUT_CONFIG at a file somewhere else.
Each line has the form Action = Type:Value:
| Type | Values | Example |
|---|---|---|
KEY | Any key name SDL accepts | Cross = KEY:Return |
MOUSE | Left, Middle, Right, X1, X2 | Square = MOUSE:Left |
WHEEL | Up, Down (pad buttons only) | R1 = WHEEL:Up |
- Action names are not case-sensitive. Lines starting with
#or;are comments. - The first line for an action replaces its built-in bindings. Further lines for the same action add alternatives.
- Actions you leave out keep their built-in bindings.
- An invalid line stops input initialisation and reports the file and line number, so mistakes are easy to find.
Action names
These are all the actions the file understands.
| Group | Actions |
|---|---|
| Face buttons | Cross Circle Triangle Square |
| Shoulders and sticks | L1 R1 L2 R2 L3 R3 Options |
| D-pad | Up Right Down Left |
| Left stick | LeftStickLeft LeftStickRight LeftStickUp LeftStickDown |
| Right stick | RightStickLeft RightStickRight RightStickUp RightStickDown |
| Touchpad and window | TouchLeft TouchRight ToggleMouse ToggleFullscreen |
INI generator
Pick an action, click the capture box, then press a key, click a mouse button or scroll. Repeat to add alternatives. Nothing leaves your browser.
Key names follow SDL's naming (for example Return, Space, Left Shift). The ; and # keys
cannot be bound from a file because they start a comment.
Example file
This is the example from the upstream documentation. It binds Cross to F or Space, moves the left stick to I/J/K/L, puts Square and R2 on the mouse buttons, and leaves everything else on the defaults.
Cross = KEY:F
Cross = KEY:Space
LeftStickLeft = KEY:J
LeftStickRight = KEY:L
LeftStickUp = KEY:I
LeftStickDown = KEY:K
Square = MOUSE:Left
R2 = MOUSE:Right
ToggleMouse = MOUSE:Middle
Reference: docs/user/INPUT_MAPPING.md.
Scripted input for test runs
For automated testing, AnyPS5 can read controller presses from a command file. Set APS5_PAD_INPUT_FILE to an absolute path before
launching, then use the helper script from the repository in a second terminal:
APS5_PAD_INPUT_FILE=/tmp/anyps5-pad ./app.elf
python3 tools/pad_input.py /tmp/anyps5-pad cross
python3 tools/pad_input.py /tmp/anyps5-pad down --hold-ms 500
python3 tools/pad_input.py /tmp/anyps5-pad release
A press lasts 300 ms by default and is added on top of any physical controller input. --hold-ms accepts 1 to 5000. The file holds only the
latest command, so wait for a release to be observed before sending the next press.