feat(pad): reload the input mapping at runtime, with a file watch and pad chords #17500
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17500"
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 MarcZX10 on 2026-11-08T20:06:38Z.
What
Pad and keyboard input mapping can change while the title runs, without a restart:
ReloadInputMapping(F1 by default, or aPAD:chord) readsanyps5-input.iniand the title's profile again. The new file is read completely before anything changes; if it has an error, the current mapping stays and the error names the file, the line and the reason.ANYPS5_INPUT_WATCH=1checks the modification time and size of the file and the profile about once a second on a background thread, and reloads only after a change has stayed the same for one check.PAD:chords trigger emulator actions from controller buttons held together. Their buttons still reach the title's pad state.The three parts share the mapping snapshot store and the input thread, which is why they are one PR.
Commits: mapping snapshot store and its swap on the input thread; text parser with file and line errors; the reload action and its default key; the file stamp and change debounce with the watch flag; pad chord parsing and dispatch; docs per commit.
Test fix:
reloadErrorNamesLineassumed that the default table binds Cross once, socrossOnKeycould never hold on the default configuration (Cross is bound to RETURN and SPACE). The test now takes a copy before the failed reload and requires the whole configuration to be unchanged, field by field.Tested
Linux, Debian kernel 6.1.0-54-amd64, Intel Xeon E5-1620 v2. Pad tests do not need a display.
Command:
Output:
Not verified:
Overlap: no open PR implements the reload, the file watch or the pad chords. #17149 (
WHEEL:LeftandWHEEL:Right) adds awheelTiltfield toInputBindingand changes the same wheel parser, duplicate check and wheel event handling inInputMapping.cpp,InputMapping.hppandKeyboardMouse.cpp. The two will conflict. Whichever merges second must also comparewheelTiltinsameBindingin the new test; this PR does not, because that field does not exist here yet.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)Pull request closed