feat(input): turn mouse speed into a smooth right-stick tilt #4704
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4704"
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-12T19:18:34Z.
What
The captured mouse (
ToggleMouse) polledSDL_GetRelativeMouseStateevery 33 ms and tilted the right stick byclamp(distance * sensitivity + 16, 64, 128): any movement tilted the stick at least halfway, the tilt depended on the poll interval, and nothing could be tuned exceptMouseSensitivity(#4009).Mouse motion is now accumulated from
SDL_MOUSEMOTIONevents and turned into a speed in counts per second, so the same hand speed gives the same tilt at any frame rate. The keyboard and mouse logic moves out ofPadInputintoPad::KeyboardMouse(libScePad/include/KeyboardMouse.hpp), which takes its time as an argument and so can be tested offline;PadInputkeeps the SDL calls.MouseMaxSpeed, shaped byMouseCurveand lifted byMouseDeadzoneOffset, so slow movement clears the game's own deadzone without the old half-tilt jump.MouseDecayMsafter the last movement.MouseSensitivity:MouseVerticalScale,MouseCurve,MouseDeadzoneOffset,MouseMaxSpeed,MouseSmoothingMs,MouseDecayMs. Invalid or repeated values stop initialization with file and line, like the existing settings.MouseSensitivitykeeps its range (above 0, at most 10) and name. At 1, 3000 counts per second is a full tilt. The old behaviour is approximated byMouseDeadzoneOffset = 0.5,MouseSmoothingMs = 0,MouseDecayMs = 33; the defaults change how the mouse feels, deliberately.SDL_HINT_MOUSE_RELATIVE_MODE_WARP=0andSDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE=0, so the pointer speed of the operating system does not apply.docs/user/INPUT_MAPPING.mdgains a "Mouse as the right stick" section and the settings table.New test
pad_keyboard_mouse(tests/KeyboardMouse.cpp,tests/PadSimulation.hpp) feeds timed events intoPad::KeyboardMouseand samples the pad state at 33, 8 and 1 ms polls: steady deflection follows the curve, the stick centers within the decay time, a flick above full speed does not extend the tail, integrated deflection agrees across poll rates, plus the key, wheel and focus-loss paths.pad_input_mappinggains parsing and rejection cases for the new settings.Tested
Not tested in a title; no game was run. Windows 11 build node (WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON): full build and the non-GPU ctest set, includingpad_input_mappingand the newpad_keyboard_mouse.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functions (#674 edits bindings through an ImGui editor, #3456 is a browser editor for the ini, #4217 captures the host cursor for guest mice; none changes the analog conversion)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (none added).mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T21:00:58Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceVideoOut/src/PadInput.cppL226-260Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T12:27:18Z.
Windows test: head
d7ca998ddmerged onto currentmainff8fe4dbc, together with 6 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest for the tests this change adds or touches: pad_input_mapping passed, pad_keyboard_mouse passed;python tools/check_conventions.py --base upstream/mainpassed for the combined tree. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T15:05:54Z.
Checked on current
main: merged as is, the build failed becausePadInput::MouseModeEnabled()(added by #4217) still returned the removedmouseEnabled. I pushed one commit that makes it returnkeyboardMouse.MouseMode(), rebased onmain.pad_input_mappingandpad_keyboard_mousepass; the new test does not build without the change.Merging once CI is green.
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T15:06:57Z.
Thanks @adriadam10. That's the right fix:
MouseModeEnabled()came in with #4217 after my last rebase, andkeyboardMouse.MouseMode()is the state it should report now.