feat(libScePad): analog keyboard input with a stick modifier and stick and trigger ramps #7500
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7500"
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:36:01Z.
What
Keys move a stick fully or not at all, and a key bound to L2 or R2 presses the trigger to 255 at once. Walking slowly, steering a vehicle or feathering a throttle with the keyboard is not possible. Three opt-in changes, one per commit, all off or unbound by default, so the built-in behaviour and the bytes reported to the title are unchanged:
StickModifieraction (no built-in binding) andStickModifierScale(0.05 to 1, default 0.5). While a key or mouse button bound toStickModifieris held, keyboard stick bindings tilt the stick by the scale instead of fully. Opposite keys still cancel. Controller sticks and the mouse stick are not affected.KeyboardRampMs(0 to 2000, default 0 = off). The keyboard stick axes move toward their target at a steady speed (full range in that many milliseconds) instead of jumping, and back the same way.Pad::KeyboardMouse::Advancenow also returns true while an axis is still moving, soPadInput::Updatepublishes the new state without an input event.TriggerRampMs(0 to 2000, default 0 = off). The same for a key or mouse button bound to L2 or R2. The digital bit follows the analog value (set while it is above 0). A pressed controller trigger is not slowed: the larger of the two values is passed on.An axis reaches
StickByte(+-1)= 255 or 0 exactly, so with the settings at their defaults the sticks report the same bytes as before (0, 128, 255).docs/user/INPUT_MAPPING.mddocuments the action, the three settings and a section "Analog keyboard input".Not included: a default key for
StickModifier(Left AltisR1in the built-in bindings), wheel-driven trigger levels, and any default-binding change.Tested
438e1baa3plus the CI scaffolding commit; run 39113655574, ctest-R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among thempad_keyboard_mouseandpad_input_mapping. Not run on Windows.pad_keyboard_mouse, with timed events through the existing simulation (PadSimulation::Simulate):stick modifier: half tilt (64 and 192) while held with a key or a mouse button, opposite keys cancel, full tilt again on release, the modifier alone moves nothing, scales 0.25 and 1.keyboard ramp: a 100 ms ramp is 0.2 after 20 ms and 0.5 after 50 ms, reaches full tilt, moves only in one direction, returns at the same speed after release, stops at a modified tilt, andRelease()centres it at once.ramp keeps advance reporting:Advancereturns true while the axis moves and false when it has settled or nothing is held.trigger ramp: without a ramp a press is 255 at once; with 100 ms it starts at 0 with the bit clear, is about half after 50 ms, ends at 255, returns the same way; a controller trigger above the ramp value is passed on.pad_input_mapping: the new action and settings are read case-insensitively, take their defaults, and reject out-of-range, non-numeric and duplicate values; a wheel direction cannot be aStickModifier.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pylists #6353 (a newInputControlvalue next toTouchRight, theactionsarray and theComposeswitch: textual overlap, no shared function; a rebase of whichever merges second) and #6012 (the list of actions indocs/user/INPUT_MAPPING.md), and could not compare #674, #4891 and #7201 (InputMapping.cpp,InputMapping.hpp, docs). 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 github-actions[bot] on 2026-10-18T10:31:41Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceVideoOut/src/InputMapping.cppdocs/user/INPUT_MAPPING.mdcore/libs/prx/libScePad/include/InputMapping.hppcore/libs/prx/libScePad/include/PadInputTypes.hppcore/libs/prx/libSceVideoOut/src/InputMapping.cppdocs/user/INPUT_MAPPING.mdcore/libs/prx/libScePad/include/InputMapping.hppcore/libs/prx/libScePad/include/KeyboardMouse.hppcore/libs/prx/libScePad/include/PadInputTypes.hppcore/libs/prx/libSceVideoOut/src/InputMapping.cppcore/libs/prx/libSceVideoOut/src/KeyboardMouse.cppcore/libs/prx/libSceVideoOut/tests/KeyboardMouse.cppdocs/user/INPUT_MAPPING.mdcore/libs/prx/libSceVideoOut/src/InputMapping.cppImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-18T16:32:20Z.
Rebase handoff — rebased onto current
main(all three commits, authorship unchanged). One docs conflict inINPUT_MAPPING.md, unioned.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the two knownmainregressions (agc_driver_tessellation— Mesa, #5444;agc_driver_bda_device— #7584), neither from this PR.To pick it up:
Head is
039986ba1.Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-18T18:13:46Z.
@blawesom thanks. I updated the branch with a merge of
main(head5dbdd6b79) rather than a rebase. The only conflict wasINPUT_MAPPING.md: I took main's action list (withTogglePerformanceOverlay) and addedStickModifierafterTouchRight. Your tree had the "Supported actions" line twice. The code matches yours. Fork CI 9/9 (run 39146965464).AI-assisted: yes (Claude Code)