Skip to content

feat(libScePad): analog keyboard input with a stick modifier and stick and trigger ramps - #7500

Merged
oneandonlydean merged 5 commits into
boykopovar:mainfrom
AlxcBTW:pr/input-analog-keys
Oct 18, 2026
Merged

oneandonlydean merged 5 commits into
boykopovar:mainfrom
AlxcBTW:pr/input-analog-keys

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

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:

  1. StickModifier action (no built-in binding) and StickModifierScale (0.05 to 1, default 0.5). While a key or mouse button bound to StickModifier is 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.
  2. 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::Advance now also returns true while an axis is still moving, so PadInput::Update publishes the new state without an input event.
  3. 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.md documents the action, the three settings and a section "Analog keyboard input".

Not included: a default key for StickModifier (Left Alt is R1 in the built-in bindings), wheel-driven trigger levels, and any default-binding change.

Tested

  • Linux (Ubuntu 24.04, GCC 13, Mesa lavapipe runner), fork CI at a210a8e (the PR head 438e1ba plus the CI scaffolding commit; run 39113655574, ctest -R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among them pad_keyboard_mouse and pad_input_mapping. Not run on Windows.
  • New checks in 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, and Release() centres it at once.
    • ramp keeps advance reporting: Advance returns 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 a StickModifier.
  • Not tested in a game with a real keyboard.
  • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists feat(pad): add a Shake input that swings the reported motion while held #6353 (a new InputControl value next to TouchRight, the actions array and the Compose switch: textual overlap, no shared function; a rebase of whichever merges second) and feat(agc,videoout): show an optional performance overlay with F10 #6012 (the list of actions in docs/user/INPUT_MAPPING.md), and could not compare feat(input): add native SDL input configuration with ImGui #674, feat(agc,videoout): save the displayed frame as a PNG with a screenshot key #4891 and Macos port #7201 (InputMapping.cpp, InputMapping.hpp, docs). Based on cdb7ed0.

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 under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 674 core/libs/prx/libSceVideoOut/src/InputMapping.cpp
docs/user/INPUT_MAPPING.md
PR 4891 core/libs/prx/libScePad/include/InputMapping.hpp
core/libs/prx/libScePad/include/PadInputTypes.hpp
core/libs/prx/libSceVideoOut/src/InputMapping.cpp
docs/user/INPUT_MAPPING.md
PR 6353 core/libs/prx/libScePad/include/InputMapping.hpp
core/libs/prx/libScePad/include/KeyboardMouse.hpp
core/libs/prx/libScePad/include/PadInputTypes.hpp
core/libs/prx/libSceVideoOut/src/InputMapping.cpp
core/libs/prx/libSceVideoOut/src/KeyboardMouse.cpp
core/libs/prx/libSceVideoOut/tests/KeyboardMouse.cpp
docs/user/INPUT_MAPPING.md
PR 7201 core/libs/prx/libSceVideoOut/src/InputMapping.cpp

@github-actions github-actions Bot added docs prx needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (all three commits, authorship unchanged). One docs conflict in INPUT_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 known main regressions (agc_driver_tessellation — Mesa, #5444; agc_driver_bda_device — #7584), neither from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7500
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 039986ba1.

@AlxcBTW

AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@blawesom thanks. I updated the branch with a merge of main (head 5dbdd6b79) rather than a rebase. The only conflict was INPUT_MAPPING.md: I took main's action list (with TogglePerformanceOverlay) and added StickModifier after TouchRight. Your tree had the "Supported actions" line twice. The code matches yours. Fork CI 9/9 (run 39146965464).

AI-assisted: yes (Claude Code)

@oneandonlydean oneandonlydean self-assigned this Oct 18, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@oneandonlydean
oneandonlydean merged commit bd7cd1b into boykopovar:main Oct 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants