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

Merged
dantdmdarealguy merged 1 commit from upstream-pr/4009 into main 2026-10-12 10:51:55 +00:00
dantdmdarealguy commented 2026-10-11 21:14:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-11T21:14:38Z.


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.

Replaces #2511, which the intake pause closed and GitHub won't reopen; the branch is rebased on current main.

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 Release build on 0a8b1d32b:

  • cmake --build of everything succeeds with no warnings in the touched files; tools/check_test_registration.py and python3 tools/check_conventions.py --base origin/main pass.
  • ctest -R "pad_input_mapping|pad_sdl|patched_libraries": 3/3 pass. patched_libraries loads the patched libSceVideoOut.prx.
  • New pad_input_mapping test (tests/InputMapping.cpp + src/InputMapping.cpp), which fails to build on main (no Pad::InputConfiguration or Pad::StickWithDeadzone): 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:4822400517 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4009). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-11T21:14:38Z. --- ### 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`. Replaces #2511, which the intake pause closed and GitHub won't reopen; the branch is rebased on current `main`. 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 Release build on `0a8b1d32b`: - `cmake --build` of everything succeeds with no warnings in the touched files; `tools/check_test_registration.py` and `python3 tools/check_conventions.py --base origin/main` pass. - `ctest -R "pad_input_mapping|pad_sdl|patched_libraries"`: 3/3 pass. `patched_libraries` loads the patched `libSceVideoOut.prx`. - New `pad_input_mapping` test (`tests/InputMapping.cpp` + `src/InputMapping.cpp`), which fails to build on `main` (no `Pad::InputConfiguration` or `Pad::StickWithDeadzone`): 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
rustybusgaming commented 2026-10-11 22:05:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rustybusgaming on 2026-10-11T22:05:38Z.


Yeah nah mate

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114354339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4009#issuecomment-6114354339). Originally posted by [rustybusgaming](https://github.com/rustybusgaming) on 2026-10-11T22:05:38Z. --- Yeah nah mate
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!4009
No description provided.