feat(pad): map Xbox View button to PS5 touchpad #593

Merged
hamb3r merged 3 commits from upstream-pr/593 into main 2026-10-05 23:15:42 +00:00
hamb3r commented 2026-10-05 00:11:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-05T00:11:33Z.


What

Controllers other than DualShock 4 and DualSense lack a dedicated touchpad button, leaving players with Xbox or generic controllers unable to trigger game actions bound to the PS5 Touchpad (such as opening maps, journals or menus).

Maps SDL_CONTROLLER_BUTTON_BACK (the View button on Xbox controllers) to PadButton::TouchPad for non-PlayStation controllers. PlayStation controllers (DualShock 4 and DualSense) already expose their physical touchpad click separately and report Share/Create as BACK, so their behavior remains unchanged.

Ported from OverkillLabs2/SoS-PS5#16 by @saulob.

Tested

Windows 10 / 11, AMD Ryzen 7 7700, NVIDIA GeForce RTX 3080. Tested with God of War: Sons of Sparta (PPSA28997) using an Xbox controller: View button consistently opens the in-game Map/Journal, matching native PS5 Touchpad behavior. Start continues to open Options/Menu. Built with MinGW-w64 GCC 15.2.0. git diff --check is clean.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. I reviewed and take responsibility for every line.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4738650445 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/593). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-05T00:11:33Z. --- ### What Controllers other than DualShock 4 and DualSense lack a dedicated touchpad button, leaving players with Xbox or generic controllers unable to trigger game actions bound to the PS5 Touchpad (such as opening maps, journals or menus). Maps `SDL_CONTROLLER_BUTTON_BACK` (the View button on Xbox controllers) to `PadButton::TouchPad` for non-PlayStation controllers. PlayStation controllers (DualShock 4 and DualSense) already expose their physical touchpad click separately and report Share/Create as BACK, so their behavior remains unchanged. Ported from OverkillLabs2/SoS-PS5#16 by @saulob. ### Tested Windows 10 / 11, AMD Ryzen 7 7700, NVIDIA GeForce RTX 3080. Tested with God of War: Sons of Sparta (PPSA28997) using an Xbox controller: View button consistently opens the in-game Map/Journal, matching native PS5 Touchpad behavior. Start continues to open Options/Menu. Built with MinGW-w64 GCC 15.2.0. `git diff --check` is clean. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. I reviewed and take responsibility for every line.
oneandonlydean commented 2026-10-05 01:18:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T01:18:39Z.


Thanks, mapping View to the touchpad button for non-PlayStation controllers makes sense, and DualShock 4 and DualSense keep their own touchpad click.

One thing: this sets only the touchpad button bit, with no touch contact. On the console a touchpad click always comes with a contact, and main's keyboard bindings already follow that: TouchLeft/TouchRight set the button together with a contact on the left or right half (PadState.cpp, touch_data_touch0_x 480 or 1440). A title that reads where the click was would see a click with no finger. Could View go through the same path, for example by setting touchLeft (or a contact in the middle)? PadInput::publish builds the published state field by field and doesn't copy touchLeft from the controller state, so it needs setting there or a contact added to result.touch.

PPSA21564 runs with a DualSense here, so this doesn't change anything in my runs. The CI run still needs workflow approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5986483745 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/593#issuecomment-5986483745). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T01:18:39Z. --- Thanks, mapping View to the touchpad button for non-PlayStation controllers makes sense, and DualShock 4 and DualSense keep their own touchpad click. One thing: this sets only the touchpad button bit, with no touch contact. On the console a touchpad click always comes with a contact, and main's keyboard bindings already follow that: `TouchLeft`/`TouchRight` set the button together with a contact on the left or right half (PadState.cpp, `touch_data_touch0_x` 480 or 1440). A title that reads where the click was would see a click with no finger. Could View go through the same path, for example by setting `touchLeft` (or a contact in the middle)? `PadInput::publish` builds the published state field by field and doesn't copy `touchLeft` from the controller state, so it needs setting there or a contact added to `result.touch`. PPSA21564 runs with a DualSense here, so this doesn't change anything in my runs. The CI run still needs workflow approval.
hamb3r commented 2026-10-05 13:39:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-05T13:39:23Z.


@oneandonlydean Implemented the touch-contact follow-up in aad1be52.

For non-PlayStation controllers, the View button still maps to the PS5 touchpad button. When SDL reports no real touch contact, we now add one synthetic contact at the center of the touchpad (960, 471). Existing real touch contacts are preserved.

Added regression coverage for the published touch state. Local checks passed: guest_pad, pad_sdl, and the libSceVideoOut target. The implementation commit passed Linux and Windows CI. Follow-up commit ca2cbc29 only removes an explanatory code comment that conflicted with the repository coding conventions; its CI run is in progress.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5995633758 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/593#issuecomment-5995633758). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-05T13:39:23Z. --- @oneandonlydean Implemented the touch-contact follow-up in `aad1be52`. For non-PlayStation controllers, the View button still maps to the PS5 touchpad button. When SDL reports no real touch contact, we now add one synthetic contact at the center of the touchpad (`960, 471`). Existing real touch contacts are preserved. Added regression coverage for the published touch state. Local checks passed: `guest_pad`, `pad_sdl`, and the `libSceVideoOut` target. The implementation commit passed Linux and Windows CI. Follow-up commit `ca2cbc29` only removes an explanatory code comment that conflicted with the repository coding conventions; its CI run is in progress.
github-actions[bot] commented 2026-10-05 15:47:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T15:47:30Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#674 core/libs/prx/libSceVideoOut/src/PadInput.cpp L123-162, L176-187
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5997944860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/593#issuecomment-5997944860). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-05T15:47:30Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #674 | `core/libs/prx/libSceVideoOut/src/PadInput.cpp` [L123-162](https://github.com/boykopovar/AnyPS5/blob/7887d885b6b13a360c9d6abe5d26b751556586ce/core/libs/prx/libSceVideoOut/src/PadInput.cpp#L123-L162), [L176-187](https://github.com/boykopovar/AnyPS5/blob/7887d885b6b13a360c9d6abe5d26b751556586ce/core/libs/prx/libSceVideoOut/src/PadInput.cpp#L176-L187) | | |
hamb3r commented 2026-10-05 20:19:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-05T20:19:49Z.


@oneandonlydean The requested touch-contact fix is implemented in ca2cbc29 and is ready for review.

PR #674 refactors PadInput::sampleController() into InputConfig::SampleController(). Please preserve PR #593's non-PlayStation SDL_CONTROLLER_BUTTON_BACK -> TouchPad mapping and synthetic touch contact when integrating it. This is an integration conflict, not a dependency, so #593 remains Depends on: none.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6002225536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/593#issuecomment-6002225536). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-05T20:19:49Z. --- @oneandonlydean The requested touch-contact fix is implemented in ca2cbc29 and is ready for review. PR #674 refactors PadInput::sampleController() into InputConfig::SampleController(). Please preserve PR #593's non-PlayStation SDL_CONTROLLER_BUTTON_BACK -> TouchPad mapping and synthetic touch contact when integrating it. This is an integration conflict, not a dependency, so #593 remains Depends on: none.
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!593
No description provided.