feat(libScePad): read per-title input profiles beside the shared input file #7499
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7499"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-18T09:35:55Z.
What
anyps5-input.ini(or the fileANYPS5_INPUT_CONFIGnames) applies to every title. Mouse sensitivity, curve and bindings that suit one title do not suit the next, and the only way to switch is to edit the file or setANYPS5_INPUT_CONFIGfor each launch.Pad::LoadInputMapping(titleId)now reads a second file after the shared one:anyps5-input.<TITLEID>.iniin the same directory as the shared file (beside the executable, or beside the fileANYPS5_INPUT_CONFIGnames), where<TITLEID>is the running title's ID fromGetAppTitleId_nid_postfix. The profile has the same format and overrides only what it lists: an action it names replaces the bindings from the shared file (and the built-in ones), a setting it names replaces the shared value, everything else stays. A missing profile is not an error; an invalid line in one reports the profile's path and line like the shared file does. A title ID is used only if it has at most 32 characters of letters, digits,_and-(Pad::InputProfileName), so an ID can never name a path outside the directory.The parsing loop moved unchanged into one function (
loadInputFile) that both files use; each file keeps its own "first line replaces, later lines add" and "setting given twice" state. With no profile, or no title ID, the result is the same as before.docs/user/INPUT_MAPPING.mdhas a "Per-game profiles" section.Tested
636cc9e58plus the CI scaffolding commit; run 39115078106, ctest-R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among thempad_input_mapping. Not run on Windows. An earlier run of the previous head (39113712815) failed to compile (InputBindingunqualified in the moved loop) and was fixed before this one.pad_input_mapping: profile names (valid IDs, empty, path separator, dot, over the length limit); a profile overrides and adds settings and replaces the bindings of an action it lists; another title ID and no title ID keep the shared file; a partial profile keeps what it does not list; a profile may set a setting the shared file also sets; an invalid profile names its file and line and does not affect other titles.PadInput(GetAppTitleId_nid_postfix, trimmed at the first NUL) is covered only by compiling.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pylists no overlap with a comparable pull request and could not compare #674, #4891 and #7201 (InputMapping.cpp,PadInput.cpp,InputMapping.hpp, docs); #674 (an input editor) also changesPadInput.cppandINPUT_MAPPING.md. Based oncdb7ed035.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:44:36Z.
Windows run, since the description lists Windows as not run. Windows 11 26300, Ryzen AI 7 350, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON.main6efb7261bwith this PR (636cc9e58) merged alone. It conflicts with #7496 to #7498, so it was not combined with them.The build is clean.
pad_input_mapping, which holds the new profile checks, together withpad_keyboard_mouseandpad_sdl, passes 3 runs of 3.AI-assisted
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-18T16:48:11Z.
@LeandroLP23 thanks for the Windows run. The conflict with #7496 to #7498 is textual: all four add rows to the default-bindings table in
docs/user/INPUT_MAPPING.mdand touch the same binding list. Whichever merges first, I rebase the others onto it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T20:22:35Z.
One small change before merge: the example profile name in
docs/user/INPUT_MAPPING.md("for exampleanyps5-input.PPSA16064.ini") uses a real title's ID. We keep user docs free of specific titles. Could you use a placeholder such asanyps5-input.PPSA00000.inithere, and inprofileNames()intests/InputMapping.cpp(the 4PPSA16064lines)? The other profile tests already usePPSA00001/PPSA00002, so any made-up ID works.The rest reads well: the loop moved unchanged, each file keeps its own override state, and
InputProfileNamecan't name a path outside the directory. Heads-up on order: this conflicts with #7496 and #7500 intests/InputMapping.cpp(and with #7500 inINPUT_MAPPING.md). They're add/add conflicts at the same spot, and keeping both sides resolves them. Whichever lands second will need a rebase.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T08:02:36Z.
Rebase handoff — rebased onto current
main(authorship unchanged). Test-function conflicts unioned (main's newer stick-modifier/keyboard-ramp tests kept alongside your profile tests, with the runner calls integrated); docs unioned.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; the input-mapping tests pass; conventions pass; full suite green apart from the four knownmainregressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.To pick it up:
Head is
8942f4739.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T08:53:24Z.
@blawesom thanks for the rebase. The code and tests come through exactly as reviewed, and main's stick-modifier and keyboard-ramp tests are all still there and called next to the profile tests.
One fix is needed in
docs/user/INPUT_MAPPING.md: in the per-game profile example, the```inifences got lost and main's next heading ended up on the example's last line:It should read:
@AlxcBTW this is a real rebase (it doesn't contain your current head), so
--ff-onlywon't pick it up. Once the docs fix is onrebase/7499, adopting it would begit fetch https://github.com/blawesom/AnyPS5 rebase/7499, thengit reset --hard FETCH_HEADon your branch andgit push --force-with-lease. Or you can mergemaininto your branch yourself. ThePPSA16064example ID from the earlier comment still needs swapping for a placeholder, and that can go in the same push.