feat(pad): support SDL controller button remapping #19538

Merged
bipinkrish merged 2 commits from upstream-pr/19538 into main 2026-11-14 20:01:06 +00:00
bipinkrish commented 2026-11-13 13:59:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bipinkrish on 2026-11-13T13:59:22Z.


What

Add source-based controller remapping to anyps5-input.ini. For example, SDLButton:a = Circle and SDLButton:b = Cross swap the two face buttons. None disables a button. Per-title profiles and runtime reload use the existing input mapping snapshot. Controller overrides preserve keyboard and mouse bindings. Existing PAD: chords use the resulting guest buttons.

Part of #392. Edit these entries by hand after exporting from the browser configurator. A mixed INI import reports the unsupported line and preserves the current editor configuration.

Tested

Ubuntu 24.04.4 x86-64, GCC 13.3.0, Release. Ran pad_input_mapping, pad_keyboard_mouse, pad_sdl, video_out_flip_controls, and video_out_flip_present on main at 228330220ba and this branch. The SDL virtual-controller test checks default and remapped buttons, a disabled button, full trigger output, synthesized touch, reload while held, rejected duplicate overrides and reload through a remapped PAD: chord.

Ran the focused CTest comparison with Xvfb, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer. Both logs show the Vulkan loader inserting Khronos validation 1.4.335 for both VideoOut tests. Both logs contain zero VUID errors and zero missing-layer diagnostics. All five tests passed on both revisions. A separate Node probe verified the browser parser rejects SDLButton: lines and I confirmed its import handler returns before replacing the editor state.

tools/check_conventions.py passed against both origin/main and upstream/main. The overlap tool scanned 1,506 open PRs and could not compare five older branches that already conflict with the base. I reviewed the shared diffs and did file-level three-way comparisons for #17596, #17625, #17712, #17717 and #17745. Their changes cover reload watching, mouse motion as gyro, or host menus. The shared files that already merged cleanly with main also merged cleanly with this change. The same comparison for #18783 combined cleanly.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Mesa llvmpipe (LLVM 20.1.2, lavapipe driver 25.2.8), Ubuntu 24.04.4 x86-64
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5296774808 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19538). Originally posted by [bipinkrish](https://github.com/bipinkrish) on 2026-11-13T13:59:22Z. --- ### What Add source-based controller remapping to `anyps5-input.ini`. For example, `SDLButton:a = Circle` and `SDLButton:b = Cross` swap the two face buttons. `None` disables a button. Per-title profiles and runtime reload use the existing input mapping snapshot. Controller overrides preserve keyboard and mouse bindings. Existing `PAD:` chords use the resulting guest buttons. Part of #392. Edit these entries by hand after exporting from the browser configurator. A mixed INI import reports the unsupported line and preserves the current editor configuration. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu 24.04.4 x86-64, GCC 13.3.0, Release. Ran `pad_input_mapping`, `pad_keyboard_mouse`, `pad_sdl`, `video_out_flip_controls`, and `video_out_flip_present` on `main` at `228330220ba` and this branch. The SDL virtual-controller test checks default and remapped buttons, a disabled button, full trigger output, synthesized touch, reload while held, rejected duplicate overrides and reload through a remapped `PAD:` chord. Ran the focused CTest comparison with Xvfb, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer`. Both logs show the Vulkan loader inserting Khronos validation 1.4.335 for both VideoOut tests. Both logs contain zero VUID errors and zero missing-layer diagnostics. All five tests passed on both revisions. A separate Node probe verified the browser parser rejects `SDLButton:` lines and I confirmed its import handler returns before replacing the editor state. `tools/check_conventions.py` passed against both `origin/main` and `upstream/main`. The overlap tool scanned 1,506 open PRs and could not compare five older branches that already conflict with the base. I reviewed the shared diffs and did file-level three-way comparisons for #17596, #17625, #17712, #17717 and #17745. Their changes cover reload watching, mouse motion as gyro, or host menus. The shared files that already merged cleanly with main also merged cleanly with this change. The same comparison for #18783 combined cleanly. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: Mesa llvmpipe (LLVM 20.1.2, lavapipe driver 25.2.8), Ubuntu 24.04.4 x86-64 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!19538
No description provided.