feat(input): configure stick deadzones and mouse sensitivity #2511

Closed
dantdmdarealguy wants to merge 1 commit from upstream-pr/2511 into main
dantdmdarealguy commented 2026-10-10 00:15:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-10T00:15:11Z.


What

Adds three settings to anyps5-input.ini, next to the existing Action = TYPE:VALUE lines:

LeftStickDeadzone = 12
RightStickDeadzone = 8
MouseSensitivity = 2.5
  • LeftStickDeadzone / RightStickDeadzone: whole percent from 0 to 90 of a controller stick's travel that reads as centered. The deadzone is radial, and the travel outside it is rescaled so a full tilt (including a full diagonal) still reaches the edge, with no jump at the boundary. Keyboard and mouse stick bindings aren't affected. This helps worn sticks that drift.
  • MouseSensitivity: a number above 0 and at most 10 that replaces the fixed Pad::MouseSensitivity = 1.0 factor for mouse look (ToggleMouse).
  • The defaults (0, 0, 1) keep the current mapping exactly: with a 0 deadzone Pad::StickWithDeadzone returns the same bytes as the old per-axis conversion.
  • Out-of-range or non-numeric values, and a setting given twice, stop input initialization with the file and line, like other invalid lines.

Pad::LoadInputMapping now returns the bindings together with the settings (Pad::InputConfiguration). Its only caller is PadInput.

This doesn't overlap #674, which edits bindings and has no deadzone or sensitivity settings. It touches the same parser file, so whichever lands second may need a small rebase.

Tested

Windows 11, WinLibs GCC 15.2.0 (15.2.0posix-14.0.0-ucrt-r7, as in CI), full build on 1f0c9fef:

  • cmake --build build, cmake --build build --target libs and tools/check_test_registration.py pass.
  • ctest --parallel 4: 556/560 pass. video_out_flip_lifetime and video_out_flip_controls skip because SDL's offscreen driver has no Vulkan here, and guest_video_out_wqhd_detection_no_vulkan skips as expected with a Vulkan device. hardware_oracle fails because the ld.lld on my PATH (LLVM 18) rejects the AMDGPU object; it's unrelated to this change.
  • patched_libraries passes, so the patched libSceVideoOut.prx loads.
  • python3 tools/check_conventions.py --base origin/main passes.
  • New pad_input_mapping test (tests/InputMapping.cpp + src/InputMapping.cpp): default settings; parsing alongside bindings and case-insensitive names; rejection of 91, -1, 7.5 and empty deadzones, of 0, 10.5 and non-numeric sensitivity, and of a setting given twice; a 0 deadzone matching the old byte conversion for -32768 to 32767; centering inside the deadzone; full, negative and diagonal deflection still reaching the edge; continuity just outside; rescaling in between.
  • Not tested in a title with a controller. Please try a drifting stick with LeftStickDeadzone, and mouse look with MouseSensitivity.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes, some AI assistance was used
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4807240651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2511). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-10T00:15:11Z. --- ### What Adds three settings to `anyps5-input.ini`, next to the existing `Action = TYPE:VALUE` lines: ```ini LeftStickDeadzone = 12 RightStickDeadzone = 8 MouseSensitivity = 2.5 ``` - `LeftStickDeadzone` / `RightStickDeadzone`: whole percent from 0 to 90 of a controller stick's travel that reads as centered. The deadzone is radial, and the travel outside it is rescaled so a full tilt (including a full diagonal) still reaches the edge, with no jump at the boundary. Keyboard and mouse stick bindings aren't affected. This helps worn sticks that drift. - `MouseSensitivity`: a number above 0 and at most 10 that replaces the fixed `Pad::MouseSensitivity = 1.0` factor for mouse look (`ToggleMouse`). - The defaults (0, 0, 1) keep the current mapping exactly: with a 0 deadzone `Pad::StickWithDeadzone` returns the same bytes as the old per-axis conversion. - Out-of-range or non-numeric values, and a setting given twice, stop input initialization with the file and line, like other invalid lines. `Pad::LoadInputMapping` now returns the bindings together with the settings (`Pad::InputConfiguration`). Its only caller is `PadInput`. This doesn't overlap #674, which edits bindings and has no deadzone or sensitivity settings. It touches the same parser file, so whichever lands second may need a small rebase. ### Tested Windows 11, WinLibs GCC 15.2.0 (`15.2.0posix-14.0.0-ucrt-r7`, as in CI), full build on `1f0c9fef`: - `cmake --build build`, `cmake --build build --target libs` and `tools/check_test_registration.py` pass. - `ctest --parallel 4`: 556/560 pass. `video_out_flip_lifetime` and `video_out_flip_controls` skip because SDL's `offscreen` driver has no Vulkan here, and `guest_video_out_wqhd_detection_no_vulkan` skips as expected with a Vulkan device. `hardware_oracle` fails because the `ld.lld` on my PATH (LLVM 18) rejects the AMDGPU object; it's unrelated to this change. - `patched_libraries` passes, so the patched `libSceVideoOut.prx` loads. - `python3 tools/check_conventions.py --base origin/main` passes. - New `pad_input_mapping` test (`tests/InputMapping.cpp` + `src/InputMapping.cpp`): default settings; parsing alongside bindings and case-insensitive names; rejection of 91, -1, 7.5 and empty deadzones, of 0, 10.5 and non-numeric sensitivity, and of a setting given twice; a 0 deadzone matching the old byte conversion for -32768 to 32767; centering inside the deadzone; full, negative and diagonal deflection still reaching the edge; continuity just outside; rescaling in between. - Not tested in a title with a controller. Please try a drifting stick with `LeftStickDeadzone`, and mouse look with `MouseSensitivity`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes, some AI assistance was used
github-actions[bot] commented 2026-10-10 00:15:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T00:15:22Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6091483220 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2511#issuecomment-6091483220). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T00:15:22Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2511
No description provided.