Skip to content

Stick dead zone: an Insert menu row (stick_dead_zone), issue 752 - #1298

Open
bronze-ff wants to merge 2 commits into
NotRexed:mainfrom
bronze-ff:feat/stick-dead-zone
Open

bronze-ff wants to merge 2 commits into
NotRexed:mainfrom
bronze-ff:feat/stick-dead-zone

Conversation

@bronze-ff

Copy link
Copy Markdown
Contributor

Closes #752.

This picks up #932 by @amaralthalesalves. Its author closed it to leave the feature to the maintainers, and the branch was left up for anyone to continue. The commit credits them as co-author.

What it does

Both pad paths cut each stick axis at XInput's 7849 (about 24%): pad_sdl.c's stick_value and nn_hid.c's XInput pads_read. Both now go through one function, hos_stick_axis(v, zone) in nn_hid.c. A new Stick dead zone row on the Controls tab picks the threshold: Default (24%), 5%, 10%, 15%, 20% or 30%.

  • At Default the output is the same as before for every input on both paths. An ini without the key reads as 0, which is today's behaviour.
  • The cut stays per axis, and only the threshold changes. The game's own dead zone still applies after it.
  • The row is saved as stick_dead_zone by its name. It is preset_exempt, like the other controls rows.

Changes from #932, needed for current main

Validation

On CachyOS (GCC 16, Clang 23, RTX 5060, Hyprland/Wayland), at main 7dbdcdc:

  • tests/test_stick_dead_zone.py fails on main without this change and passes with it, with gcc/g++ and with clang/clang++. It covers all 65,536 inputs on both paths: Default is the old cut, the five other thresholds are exact, and the ini parsing and labels are right.
  • tests/run_all.py reports 168 passed and 1 failed. The failure is nx2/test_nup_read_name.py, which needs zstandard, missing here.
  • In the game, a virtual USB Xbox Series controller opened the menu and went to Controls, where Stick dead zone shows < Default (24%) >. Right set it to 5% and saved stick_dead_zone=1, and Left brought it back to Default. The other controls rows in the ini were unchanged.

Not tested: the XInput path on Windows, a physical controller, and how the game feels with each threshold.

🤖 Generated with Claude Code

bronze-ff and others added 2 commits November 9, 2026 18:10
Picks up NotRexed#932 by amaralthalesalves, which its author closed to leave the
feature to the maintainers. Ported onto current main:

- Both pad paths, SDL (pad_sdl.c) and XInput (nn_hid.c), now cut each
  stick axis through nn_hid.c's hos_stick_axis, with the threshold from a
  Controls row: Default (XInput's 7849, ~24%, the same output as before for
  every input), 5%, 10%, 15%, 20%, 30%.
- Option id 10: NotRexed#932's 18 is HOS_OPT_GYRO since the motion rows came in.
- The row is preset_exempt, like the other controls rows; saved as
  stick_dead_zone by its name.
- tests/test_stick_dead_zone.py is NotRexed#932's test, adapted to the row format
  and to option 10.

Co-authored-by: Thales Amaral <amaralthalesalves@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the Stick dead zone and Audio output labels after their adjacent edits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Controller dead zone adjuster

1 participant