diff options
| author | QemmHD <stephenlethco2@gmail.com> | 2026-11-24 15:44:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 15:44:44 -0500 |
| commit | 66d4f5aa36bb6bcd006fa4b311c7a84d809fdbad (patch) | |
| tree | 5bd248f77fd28157fb2fb831e1e91924160a464f /docs | |
| parent | 22d044f60a7c7eb721a03d3f03b01f936308ff00 (diff) | |
| parent | f9ba70b4de394f803273ab60adcbef9b15849ab8 (diff) | |
Merge pull request #1074 from Moriz82/split/rt-input-script-length
Merging.
**Why merged:** RT-INPUT-SCRIPT-LENGTH: the shim's env() reader now handles values of any length (64 characters or more used to read as unset). The PR also adds the LEONIDA_INPUT_SCRIPT keyboard-pad scheduler (`button@seconds`, 300 ms presses), documented in docs/gameinput.md. That's a second topic, but the body says so, and both parts were reviewed. sodove checked 14/14 runs across lengths, with the control failing 12/12, and kawaii-shakal's harness follow-ups were addressed.
**Why it's good:** gameinput_host, gameinput and the new gameinput_script pass; with validation, gameinput_script passes and logs "8 accepted / 11 rejected". The parsing is bounded (strtod with end-pointer and finiteness checks) and reads only its own env var.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #517, #907, #927, #954 and #1074 merged onto main 32a5d9698 (after aslan2142's runtime merges). There the repo-consistency set gives 573 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 314/316 with the same 11 skips. The 2 failures are d3d12_depth_resolve (pre-existing) and d3d12_close_parity, which fails on plain 32a5d9698 too: a regression from #510, reported there, not from these PRs. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/gameinput.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/gameinput.md b/docs/gameinput.md index 39a4fd2cc..28115d103 100644 --- a/docs/gameinput.md +++ b/docs/gameinput.md | |||
| @@ -125,9 +125,9 @@ owns the game's window, which is the title's, not the shim's. | |||
| 125 | 125 | ||
| 126 | Keys are read with `GetAsyncKeyState`, which needs no window or message loop (SDL's keyboard is part of its video | 126 | Keys are read with `GetAsyncKeyState`, which needs no window or message loop (SDL's keyboard is part of its video |
| 127 | subsystem, which this build leaves out) and works under Wine. With `LEONIDA_KEYBOARD_PAD=1` keys count only while a | 127 | subsystem, which this build leaves out) and works under Wine. With `LEONIDA_KEYBOARD_PAD=1` keys count only while a |
| 128 | window of this process is in the foreground, so typing in another application presses nothing, and every button, | 128 | window of this process is in the foreground. Losing focus releases keyboard and mouse input. The cursor is read |
| 129 | stick and trigger is released when focus moves away (the cursor is read afresh when focus returns, so the right | 129 | afresh on return so the right stick does not jump. Scripted presses run with or without focus for unattended runs. |
| 130 | stick does not jump). `LEONIDA_KEYBOARD_PAD=always` reads them whatever has focus; a console tool such as | 130 | `LEONIDA_KEYBOARD_PAD=always` reads physical input whatever has focus; a console tool such as |
| 131 | `gameinput_probe` needs it, because its console window belongs to the terminal, not to the tool. | 131 | `gameinput_probe` needs it, because its console window belongs to the terminal, not to the tool. |
| 132 | - Force feedback and haptics run through a fake haptic backend (`rt::gameinput::set_haptic_source`), because SDL's | 132 | - Force feedback and haptics run through a fake haptic backend (`rt::gameinput::set_haptic_source`), because SDL's |
| 133 | virtual joysticks report no haptics: the motor count, axes and effect flags a wheel reports, and a pad without SDL | 133 | virtual joysticks report no haptics: the motor count, axes and effect flags a wheel reports, and a pad without SDL |
| @@ -302,6 +302,7 @@ line is logged when it takes effect); tracking goes on underneath, so clearing i | |||
| 302 | | `LEONIDA_PROMPTS_SWITCH_MS` | `300` | shortest time between two changes of the active input family, 0..2000 ms | | 302 | | `LEONIDA_PROMPTS_SWITCH_MS` | `300` | shortest time between two changes of the active input family, 0..2000 ms | |
| 303 | | `LEONIDA_GAMEINPUT_THREAD` | `1` | `0` stops the background poll thread; only `rt::gameinput::poll()` then reads the pads (tests) | | 303 | | `LEONIDA_GAMEINPUT_THREAD` | `1` | `0` stops the background poll thread; only `rt::gameinput::poll()` then reads the pads (tests) | |
| 304 | | `LEONIDA_KEYBOARD_PAD` | `off` | `1` adds the [keyboard pad](#keyboard-pad), read while this process has focus; `always` reads keys whatever has focus | | 304 | | `LEONIDA_KEYBOARD_PAD` | `off` | `1` adds the [keyboard pad](#keyboard-pad), read while this process has focus; `always` reads keys whatever has focus | |
| 305 | | `LEONIDA_INPUT_SCRIPT` | unset | With the keyboard pad enabled, set comma-separated `button@seconds` entries, e.g. `a@2,a@4,start@6`. The first pad update reads the script once at startup and starts the clock. `reload_config()` does not reread it. Each press lasts 300 ms. Buttons are `a b x y start back lb rb up down left right`. Spaces around entries are allowed. Empty entries, unknown buttons and invalid times (including negative or non-finite values) are counted and ignored. | | ||
| 305 | | `LEONIDA_MOUSE_SENSITIVITY` | `1` | scales how far the mouse moves the keyboard pad's right stick, 0.1..10 | | 306 | | `LEONIDA_MOUSE_SENSITIVITY` | `1` | scales how far the mouse moves the keyboard pad's right stick, 0.1..10 | |
| 306 | 307 | ||
| 307 | SDL's own hints (`SDL_JOYSTICK_*`, see SDL's `SDL_hints.h`) also apply, for example `SDL_JOYSTICK_HIDAPI_PS5=0` to | 308 | SDL's own hints (`SDL_JOYSTICK_*`, see SDL's `SDL_hints.h`) also apply, for example `SDL_JOYSTICK_HIDAPI_PS5=0` to |