gameinput: say so when LEONIDA_INPUT_SCRIPT has no keyboard pad to drive (INPUT-SCRIPT-PAD-OFF-NOTE) #2152

Open
github-bot wants to merge 2 commits from github-bot/gh-2152 into main AGit
Owner

@⁠quartz-heron-58 on GitHub · 2026-11-26 00:05 UTC · original
quartz-heron-58:input-script-pad-note → main · +39 −1 · 4 files · 2 commits · open

Claimed in the coordination issue as: INPUT-SCRIPT-PAD-OFF-NOTE (#1608)

What and why

In a build with SDL3, LEONIDA_INPUT_SCRIPT drives the keyboard pad, and the pad's update is also where the script is read. With LEONIDA_KEYBOARD_PAD unset or off the script was never parsed and nothing was logged: an unattended boot sat at the title's first prompt with no hint why. docs/gameinput.md says the pad "has to be enabled", but the run itself was silent. I lost several unattended boots to this before reading that line.

This adds one log line at configuration time, printed once a process, when a script is set and the keyboard pad is off:

[rt] gameinput: LEONIDA_INPUT_SCRIPT is set but the keyboard pad is off, so the script is not read and no scripted press will happen: with SDL3 the script drives the keyboard pad (set LEONIDA_KEYBOARD_PAD=always for an unattended run, or 1)
  • runtime/shims/gameinput_script.h: pad_off_note(script_text, keyboard_pad_on), a pure helper that returns the text or null. It does not parse the script, so a script whose entries would all be rejected is reported too, and it is outside the parser that #2144 changes.
  • runtime/shims/gameinput.cpp: read_config prints it once.
  • runtime/test/gameinput_test.cpp: six cases for the helper.
  • docs/gameinput.md: one sentence in the LEONIDA_INPUT_SCRIPT row.

No behaviour change: the pad is not switched on for the user, and a build without SDL3 is untouched (its scripted pad needs no keyboard pad).

Tested

Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo via scripts\build_runtime.ps1 -FetchSdl3 on main 33bd07cf8 plus this commit: build exit 0.

  • ctest -R gameinput: 3 of 3 pass (gameinput_host, gameinput, gameinput_script). gameinput_test.exe run directly: 370 checks, 0 failures, the six new pad-off note lines among them.
  • gameinput_probe --seconds 3 with LEONIDA_INPUT_SCRIPT=a@1,a@2:
    • LEONIDA_KEYBOARD_PAD unset: the line above once, no press lines;
    • LEONIDA_KEYBOARD_PAD=always: no such line, two press a@ lines;
    • no script: no such line.
  • scripts/check_no_game_data.py on the four changed files: clean.

Not run: the whole ctest set, a build without SDL3 (the helper is an unused inline there), Linux/Wine.

GPUs tested: n/a (no GPU code; the machine has an RTX 4080, NVIDIA 621.24)

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule)

🤖 Generated with Claude Code

**@⁠quartz-heron-58** on GitHub · 2026-11-26 00:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2152) `quartz-heron-58:input-script-pad-note` → `main` · +39 −1 · 4 files · 2 commits · open Claimed in the coordination issue as: INPUT-SCRIPT-PAD-OFF-NOTE (#1608) ### What and why In a build with SDL3, `LEONIDA_INPUT_SCRIPT` drives the keyboard pad, and the pad's update is also where the script is read. With `LEONIDA_KEYBOARD_PAD` unset or off the script was never parsed and nothing was logged: an unattended boot sat at the title's first prompt with no hint why. docs/gameinput.md says the pad "has to be enabled", but the run itself was silent. I lost several unattended boots to this before reading that line. This adds one log line at configuration time, printed once a process, when a script is set and the keyboard pad is off: ```text [rt] gameinput: LEONIDA_INPUT_SCRIPT is set but the keyboard pad is off, so the script is not read and no scripted press will happen: with SDL3 the script drives the keyboard pad (set LEONIDA_KEYBOARD_PAD=always for an unattended run, or 1) ``` - `runtime/shims/gameinput_script.h`: `pad_off_note(script_text, keyboard_pad_on)`, a pure helper that returns the text or null. It does not parse the script, so a script whose entries would all be rejected is reported too, and it is outside the parser that #2144 changes. - `runtime/shims/gameinput.cpp`: `read_config` prints it once. - `runtime/test/gameinput_test.cpp`: six cases for the helper. - `docs/gameinput.md`: one sentence in the `LEONIDA_INPUT_SCRIPT` row. No behaviour change: the pad is not switched on for the user, and a build without SDL3 is untouched (its scripted pad needs no keyboard pad). ### Tested Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo via `scripts\build_runtime.ps1 -FetchSdl3` on main 33bd07cf8 plus this commit: build exit 0. - `ctest -R gameinput`: 3 of 3 pass (gameinput_host, gameinput, gameinput_script). `gameinput_test.exe` run directly: 370 checks, 0 failures, the six new `pad-off note` lines among them. - `gameinput_probe --seconds 3` with `LEONIDA_INPUT_SCRIPT=a@1,a@2`: - `LEONIDA_KEYBOARD_PAD` unset: the line above once, no press lines; - `LEONIDA_KEYBOARD_PAD=always`: no such line, two `press a@` lines; - no script: no such line. - `scripts/check_no_game_data.py` on the four changed files: clean. Not run: the whole ctest set, a build without SDL3 (the helper is an unused inline there), Linux/Wine. GPUs tested: n/a (no GPU code; the machine has an RTX 4080, NVIDIA 621.24) AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
In a build with SDL3 the script drives the keyboard pad, and the pad's update is
where the script is read. With LEONIDA_KEYBOARD_PAD unset or off the script was
never parsed and nothing was logged, so an unattended boot sat at the title's
first prompt with no hint why.

read_config now prints one line, once a process, when a script is set and the
pad is off. The decision is a pure helper in gameinput_script.h (pad_off_note)
with six cases in gameinput_test. No behaviour change: the pad is not switched
on for the user.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:20:25 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2152/head:github-bot/gh-2152'
git switch 'github-bot/gh-2152'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2152'
git switch 'github-bot/gh-2152'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2152'
git switch 'github-bot/gh-2152'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2152'
git switch 'main'
git merge --squash 'github-bot/gh-2152'
git switch 'main'
git merge --ff-only 'github-bot/gh-2152'
git switch 'main'
git merge 'github-bot/gh-2152'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.