Add a dead zone slider per analog stick to the Controls tab, carrying an older stick_deadzone line over to both.

This commit is contained in:
Wellington Dias committed 2026-11-01 02:08:15 -03:00
1 parent f469c5a774
commit cd0917e18d
9 files changed
+102 -26

No files matched your search

+2 -2
View File
@@ -82,7 +82,7 @@ Mouse motion (raw input) becomes right-stick deflection. Each presented frame ta
`TOTK_MOUSE_SENS` (0 to 10, default 1; higher turns faster, 0 turns the mouse camera and the cursor capture off). While the window is the foreground window the cursor is hidden and confined to the client area. It is released on focus loss, minimise, while F11 changes the window, during a size or move loop and while a text entry is open. Esc releases it by hand: the cursor shows, the mouse camera and mouse buttons stop, and the window can be moved, minimised or closed. A mouse click inside the client area captures it again; that click does not reach the game. Activating the window by a click on its title bar or border does not capture, so it can be dragged or closed right away; Alt+Tab or a click in the client area captures as before. `TOTK_INPUT=none` disables the capture too.
`TOTK_STICK_DEADZONE` (0 to 50, default 8) is the gamepad stick dead zone in percent of full deflection, the same for both sticks. It is round: a stick inside the circle reads centred, and the rest of its travel is scaled to start at 0 at the edge, so full deflection still reaches full. Raise it for a stick that drifts. The game's own dead zone applies after it.
`TOTK_LSTICK_DEADZONE` and `TOTK_RSTICK_DEADZONE` (0 to 50, default 8; the Analog sticks section of the Controls tab) are the gamepad stick dead zones in percent of full deflection, one per stick. Each is round: a stick inside the circle reads centred, and the rest of its travel is scaled to start at 0 at the edge, so full deflection still reaches full. Raise one for a stick that drifts. The game's own dead zone applies after it. A `stick_deadzone` line in an older `totk.ini` is carried over to both keys at the next start and removed; `TOTK_STICK_DEADZONE` set in the environment still applies to both sticks.
The stick direction bits (`StickLLeft` to `StickRDown`) are derived from the sticks at 50% deflection. A gamepad plugged in later is picked up within one second; with none connected the log says `input: no gamepad`.
@@ -107,7 +107,7 @@ Bridges that output a ViGEm DualShock 4 (ProCon2Windows, connectyourpro as teste
`TOTK_INPUT_RECORD=<file>` (`input_record` in `totk.ini`, or Input recording in the menu) writes the merged input in the same format, one line per button press and per stick segment: events before the world clock starts by tick, the rest timed; a button or stick held when the world clock starts is cut there and goes on as a timed event. The file replays as a script, which makes it the repro to attach to a bug report.
`TOTK_TEST_PAD=<lx>,<ly>,<rx>,<ry>` attaches an SDL virtual gamepad at start whose sticks rest at these raw SDL axis values (-32768 to 32767, down is +y), so a drifting or held stick can be tested without a controller: the values go through the gamepad mapping and `TOTK_STICK_DEADZONE` like a real pad's, and `TOTK_INPUT_RECORD` shows what reached the game.
`TOTK_TEST_PAD=<lx>,<ly>,<rx>,<ry>` attaches an SDL virtual gamepad at start whose sticks rest at these raw SDL axis values (-32768 to 32767, down is +y), so a drifting or held stick can be tested without a controller: the values go through the gamepad mapping and `TOTK_LSTICK_DEADZONE` / `TOTK_RSTICK_DEADZONE` like a real pad's, and `TOTK_INPUT_RECORD` shows what reached the game.
## RenderDoc capture (blocked)