feat(input): add native SDL input configuration with ImGui #674

Closed
clevetdev wants to merge 10 commits from upstream-pr/674 into main
clevetdev commented 2026-10-05 14:10:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clevetdev on 2026-10-05T14:10:53Z.


What

Add a native Dear ImGui input editor for #392, available as anyps5-input-config [--config path] and a separate F10 window during gameplay. The editor supports keyboard/mouse alternate bindings, GUID-scoped PS5 button/axis profiles with inversion and analog previews, and a confirmed physical SDL mapping assistant for unrecognized joysticks.

Keep existing keyboard INI behavior; add NONE for disabled bindings and numeric SDL scancodes for key names that cannot round-trip through the comment syntax. Save each tab atomically, apply saved mappings live, and neutralize game input while the editor is open. Use the SDL software renderer independently of the game's Vulkan renderer. Package the tool for Windows and Linux.

This implements hardBSDk's native preference. I acknowledge the maintainer's proposed GitHub Pages direction in the issue; this contribution deliberately provides a native alternative. The shared sampler preserves the non-PlayStation Back/View touchpad behavior requested by hamb3r in #593, including a center contact when no real finger is available. Explicit TouchPad remapping or NONE overrides the default fallback; PS4/PS5 Share/Create stays separate.

Tested

  • Windows, official WinLibs GCC 15.2.0/UCRT r7: full project build and patched-library target libs succeed.
  • Five input/configuration/editor/packaging tests pass. SDL virtual devices cover buttons, hats, analog and digital triggers/sticks, inversion, disabled controls, GUID round trips, malformed files, atomic write failure, live reload, and reconnect.
  • Dummy-video UI tests exercise capture cancellation, alternate key saves, PS5 button capture, explicit SDL physical-input confirmation, saving, resize, and close/reopen. Visually inspected rendered frames of all three tabs.
  • Full Windows suite at upstream base 961acb0c: 288/290 pass. agc_driver_f32_output_modifier and agc_driver_scalar_sop1 fail on the RTX 5070 Ti; both fail identically on a separate, unmodified checkout of 961acb0c. The newly registered packaging test also passes.
  • No physical controller, commercial title, or homebrew session was tested. Runtime integration was exercised through the real PadInput class with virtual SDL devices and a test publication sink. Linux and Windows full builds, patched libraries and test suites (repeat-until-fail:3) pass on commit 4173f317 in the fork CI run. Upstream PR workflows require maintainer approval for this first-time contribution.

Keyboard and mouse bindings
PS5 command profiles
SDL physical mapping assistant

Integration with open pull requests

Rebased onto upstream 9cafa33f after #593 landed. The prior audit compared all 130 open PRs and inspected the five sharing changed files. No merge of an unrelated PR is required first.

  • #593 is now merged: its PadInput.cpp integration conflict is resolved. Preserve its Back/View button and synthetic touch contact in InputConfig::SampleController, without an unconditional second fallback that would ignore explicit profiles. Virtual generic/PS4/PS5 tests cover defaults, reassignment, NONE, release, real finger preservation, and runtime publication/suspension. Original View/contact behavior and integration feedback are credited to hamb3r.
  • #485: moved the ImGui submodule declaration away from its insertion point. Git's merge simulation is now clean and retains both submodules.
  • #600: separated root input-test registration from its CMake addition. Two textual conflicts remain in release workflow/packager code. Integration must retain both asset lists, both CTest entries, add the editor to its new portable archive file list, preserve the Linux executable bit, and retain checksums. Its release-test fixtures will need an editor binary; our input-test fixtures must use its new repository-root and compiler-metadata inputs. A scratch integration of both packagers passed Windows/Linux portable archive, standalone asset, executable permission and checksum checks; this is not part of this branch.
  • #615: clean merge simulation; the merged Windows runtime-directory override passes our Windows/Linux input packaging tests.
  • #676: clean merge simulation; removal of the Cohtml alias requirement passes our Windows/Linux input packaging tests. Do not restore that requirement when rebasing after it lands.

Local validation after the rebase: full Windows build and patched libs target succeed; six input-related CTest cases passed three consecutive times with official Windows GCC 15.2.0. Full CTest is 321/323; the same two RTX 5070 Ti GPU failures retain the exact previously reproduced mismatches (0x7f7fffff vs 0x7f800000, 0x00007fff vs 0xd4cbd76d). Linux/Windows full-build, patched libraries and test run passed on both platforms for 8986feef (323 tests, repeated three times). After integrating the merged #593, Windows libSceVideoOut builds and eight input/pad tests pass three consecutive times. Full CI passes on rebased commit 318fa88d: Linux and Windows full builds, patched libraries and all 342 tests pass, repeated three times.

Checklist

  • Based on current main; no other open PR implements this native editor (integration with overlapping PRs documented above)
  • One topic per PR; follow-ups go in a new PR
  • No new comments in code except permitted existing comments
  • Unimplemented paths are not replaced with silent stubs
  • No investigation notes, reports, logs, or screenshots added to the repository
  • New third-party code is a pinned submodule built from source (Dear ImGui v1.92.5)
  • Generic behavior, not specific to one title
  • Depends on: none
  • AI-assisted: yes, implemented and reviewed with OpenAI Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4746212292 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/674). Originally posted by [clevetdev](https://github.com/clevetdev) on 2026-10-05T14:10:53Z. --- ### What Add a native Dear ImGui input editor for #392, available as `anyps5-input-config [--config path]` and a separate F10 window during gameplay. The editor supports keyboard/mouse alternate bindings, GUID-scoped PS5 button/axis profiles with inversion and analog previews, and a confirmed physical SDL mapping assistant for unrecognized joysticks. Keep existing keyboard INI behavior; add `NONE` for disabled bindings and numeric SDL scancodes for key names that cannot round-trip through the comment syntax. Save each tab atomically, apply saved mappings live, and neutralize game input while the editor is open. Use the SDL software renderer independently of the game's Vulkan renderer. Package the tool for Windows and Linux. This implements hardBSDk's native preference. I acknowledge the maintainer's proposed GitHub Pages direction in the issue; this contribution deliberately provides a native alternative. The shared sampler preserves the non-PlayStation Back/View touchpad behavior requested by hamb3r in #593, including a center contact when no real finger is available. Explicit TouchPad remapping or NONE overrides the default fallback; PS4/PS5 Share/Create stays separate. ### Tested - Windows, official WinLibs GCC 15.2.0/UCRT r7: full project build and patched-library target `libs` succeed. - Five input/configuration/editor/packaging tests pass. SDL virtual devices cover buttons, hats, analog and digital triggers/sticks, inversion, disabled controls, GUID round trips, malformed files, atomic write failure, live reload, and reconnect. - Dummy-video UI tests exercise capture cancellation, alternate key saves, PS5 button capture, explicit SDL physical-input confirmation, saving, resize, and close/reopen. Visually inspected rendered frames of all three tabs. - Full Windows suite at upstream base `961acb0c`: 288/290 pass. `agc_driver_f32_output_modifier` and `agc_driver_scalar_sop1` fail on the RTX 5070 Ti; both fail identically on a separate, unmodified checkout of `961acb0c`. The newly registered packaging test also passes. - No physical controller, commercial title, or homebrew session was tested. Runtime integration was exercised through the real PadInput class with virtual SDL devices and a test publication sink. Linux and Windows full builds, patched libraries and test suites (repeat-until-fail:3) pass on commit `4173f317` in the [fork CI run](https://github.com/corentinlevet/AnyPS5/actions/runs/37324133623). Upstream PR workflows require maintainer approval for this first-time contribution. ![Keyboard and mouse bindings](https://gist.githubusercontent.com/corentinlevet/abfccedb3232bef6e77646214c391344/raw/89ab94ddfefd873d770f3fd03a547ddeb7ed2053/editor-keyboard.png) ![PS5 command profiles](https://gist.githubusercontent.com/corentinlevet/abfccedb3232bef6e77646214c391344/raw/ab4f1bc2f580ae6ab159f5df8adc34df18d17798/editor-controller.png) ![SDL physical mapping assistant](https://gist.githubusercontent.com/corentinlevet/abfccedb3232bef6e77646214c391344/raw/dba875289001659fede0e17bc1fec4f2b807df7e/editor-sdl.png) ### Integration with open pull requests Rebased onto upstream `9cafa33f` after #593 landed. The prior audit compared all 130 open PRs and inspected the five sharing changed files. No merge of an unrelated PR is required first. - #593 is now merged: its `PadInput.cpp` integration conflict is resolved. Preserve its Back/View button and synthetic touch contact in `InputConfig::SampleController`, without an unconditional second fallback that would ignore explicit profiles. Virtual generic/PS4/PS5 tests cover defaults, reassignment, NONE, release, real finger preservation, and runtime publication/suspension. Original View/contact behavior and integration feedback are credited to hamb3r. - #485: moved the ImGui submodule declaration away from its insertion point. Git's merge simulation is now clean and retains both submodules. - #600: separated root input-test registration from its CMake addition. Two textual conflicts remain in release workflow/packager code. Integration must retain both asset lists, both CTest entries, add the editor to its new portable archive file list, preserve the Linux executable bit, and retain checksums. Its release-test fixtures will need an editor binary; our input-test fixtures must use its new repository-root and compiler-metadata inputs. A scratch integration of both packagers passed Windows/Linux portable archive, standalone asset, executable permission and checksum checks; this is not part of this branch. - #615: clean merge simulation; the merged Windows runtime-directory override passes our Windows/Linux input packaging tests. - #676: clean merge simulation; removal of the Cohtml alias requirement passes our Windows/Linux input packaging tests. Do not restore that requirement when rebasing after it lands. Local validation after the rebase: full Windows build and patched `libs` target succeed; six input-related CTest cases passed three consecutive times with official Windows GCC 15.2.0. Full CTest is 321/323; the same two RTX 5070 Ti GPU failures retain the exact previously reproduced mismatches (`0x7f7fffff` vs `0x7f800000`, `0x00007fff` vs `0xd4cbd76d`). [Linux/Windows full-build, patched libraries and test run](https://github.com/clevetdev/AnyPS5/actions/runs/37380565318) passed on both platforms for `8986feef` (323 tests, repeated three times). After integrating the merged #593, Windows `libSceVideoOut` builds and eight input/pad tests pass three consecutive times. [Full CI](https://github.com/clevetdev/AnyPS5/actions/runs/37396213929) passes on rebased commit `318fa88d`: Linux and Windows full builds, patched libraries and all 342 tests pass, repeated three times. ### Checklist - [x] Based on current `main`; no other open PR implements this native editor (integration with overlapping PRs documented above) - [x] One topic per PR; follow-ups go in a new PR - [x] No new comments in code except permitted existing comments - [x] Unimplemented paths are not replaced with silent stubs - [x] No investigation notes, reports, logs, or screenshots added to the repository - [x] New third-party code is a pinned submodule built from source (Dear ImGui v1.92.5) - [x] Generic behavior, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes, implemented and reviewed with OpenAI Codex
adriadam10 commented 2026-10-07 15:50:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T15:50:24Z.


Thanks for the work and for documenting the overlaps. This needs a decision from the maintainers before a detailed review, so tagging them:

@boykopovar @oneandonlydean

  • Direction: in #392 the plan was a web mapping page on GitHub Pages; this PR adds a native ImGui editor instead. Do we want it in-tree?
  • New dependency: adds 3rdparty/imgui (Dear ImGui v1.92.5) as a submodule, built from source into a new anyps5_input_editor target.
  • Global change: root CMakeLists.txt flips SDL_RENDER OFF -> ON for the whole SDL build.
  • Release policy: release.yml now requires and uploads two extra assets (anyps5-input-config-<tag>[.exe]). #600 is already waiting on a release-layout decision and touches the same workflow and package_release.py.

@clevetdev, independent of the decision:

  • "Depends on: none" doesn't match the PR body, which describes a textual conflict with #600 and an overlap with #1080 (libSceVideoOut/CMakeLists.txt). List them under Depends on.
  • If the editor is accepted, consider splitting it: (1) PadInput refactor into InputConfig::SampleController + shared keyboard/controller config and tests, (2) the ImGui editor and F10 window, (3) release packaging. That keeps each piece reviewable and the packaging piece can follow whatever #600 ends up doing.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6041512857 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/674#issuecomment-6041512857). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T15:50:24Z. --- Thanks for the work and for documenting the overlaps. This needs a decision from the maintainers before a detailed review, so tagging them: @boykopovar @oneandonlydean - **Direction:** in #392 the plan was a web mapping page on GitHub Pages; this PR adds a native ImGui editor instead. Do we want it in-tree? - **New dependency:** adds `3rdparty/imgui` (Dear ImGui v1.92.5) as a submodule, built from source into a new `anyps5_input_editor` target. - **Global change:** root `CMakeLists.txt` flips `SDL_RENDER OFF -> ON` for the whole SDL build. - **Release policy:** `release.yml` now requires and uploads two extra assets (`anyps5-input-config-<tag>[.exe]`). #600 is already waiting on a release-layout decision and touches the same workflow and `package_release.py`. @clevetdev, independent of the decision: - "Depends on: none" doesn't match the PR body, which describes a textual conflict with #600 and an overlap with #1080 (`libSceVideoOut/CMakeLists.txt`). List them under Depends on. - If the editor is accepted, consider splitting it: (1) `PadInput` refactor into `InputConfig::SampleController` + shared keyboard/controller config and tests, (2) the ImGui editor and F10 window, (3) release packaging. That keeps each piece reviewable and the packaging piece can follow whatever #600 ends up doing.

Pull request closed

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!674
No description provided.