runtime: the first-run UI keyboard pad reads keys only with focus (RT-FIRST-RUN-PAD-FOCUS) #1612

Manually merged
github merged 2 commits from gh-pr/1612/head into gh-pr/1612/base 2026-11-26 09:58:02 +00:00
Owner

@⁠Tyrannys on GitHub · 2026-11-25 05:54 UTC · original
Tyrannys:first-run-pad-focus → main · +6 −3 · 4 files · 2 commits · merged 2026-11-25 19:30 UTC

Claimed in the coordination issue as: RT-FIRST-RUN-PAD-FOCUS (#1608)

What and why

gta6rt --first-run-ui set LEONIDA_KEYBOARD_PAD=always as part of its profile (configure_first_run_ui in runtime/src/main.cpp). In that mode the keyboard pad reads the physical keyboard whatever has focus, so keys typed into another program reach the title. On a first-run consent page an Enter could tick a box in the user's name. This is hazard 1 of #1552.

The profile now uses the focused mode 1. Keys count only while the title window has focus. Scripted presses (LEONIDA_INPUT_SCRIPT) still run while the window is unfocused (runtime/shims/gameinput.cpp, the active gate in the pad poll). If the caller sets LEONIDA_KEYBOARD_PAD explicitly, that setting still wins.

  • runtime/src/main.cpp: change the default from always to 1.
  • runtime/test/fixtures/tiny_game.cpp: the first-run branch checks that LEONIDA_KEYBOARD_PAD is 1.
  • runtime/CMakeLists.txt: run_tiny_first_run_ui clears LEONIDA_KEYBOARD_PAD, so the caller's shell can't mask the default.
  • docs/first_run_ui.md: says the pad is in its focused mode.

Out of scope: the boot.ps1 side (#1609, RT-KEYBOARD-PAD-SCRIPT) and the shim's own default (#1528). This PR doesn't touch either.

Tested

Windows 11, RTX 4070 SUPER (NVIDIA 621.01), MSVC. No game files.

  • ctest -R "run_tiny_first_run_ui|run_tiny_game$": 2/2 pass.
  • Negative check: with LEONIDA_KEYBOARD_PAD=always set by the caller, tiny_game prints FAIL first-run UI keyboard pad reads keys only with focus. So the check catches the old default.
  • scripts/check_no_game_data.py on the changed files: clean.

AI-assisted (Claude Code).

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

**@⁠Tyrannys** on GitHub · 2026-11-25 05:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1612) `Tyrannys:first-run-pad-focus` → `main` · +6 −3 · 4 files · 2 commits · merged 2026-11-25 19:30 UTC Claimed in the coordination issue as: RT-FIRST-RUN-PAD-FOCUS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why `gta6rt --first-run-ui` set `LEONIDA_KEYBOARD_PAD=always` as part of its profile (`configure_first_run_ui` in `runtime/src/main.cpp`). In that mode the keyboard pad reads the physical keyboard whatever has focus, so keys typed into another program reach the title. On a first-run consent page an Enter could tick a box in the user's name. This is hazard 1 of #1552. The profile now uses the focused mode `1`. Keys count only while the title window has focus. Scripted presses (`LEONIDA_INPUT_SCRIPT`) still run while the window is unfocused (`runtime/shims/gameinput.cpp`, the `active` gate in the pad poll). If the caller sets `LEONIDA_KEYBOARD_PAD` explicitly, that setting still wins. - `runtime/src/main.cpp`: change the default from `always` to `1`. - `runtime/test/fixtures/tiny_game.cpp`: the first-run branch checks that `LEONIDA_KEYBOARD_PAD` is `1`. - `runtime/CMakeLists.txt`: `run_tiny_first_run_ui` clears `LEONIDA_KEYBOARD_PAD`, so the caller's shell can't mask the default. - `docs/first_run_ui.md`: says the pad is in its focused mode. Out of scope: the `boot.ps1` side (#1609, RT-KEYBOARD-PAD-SCRIPT) and the shim's own default (#1528). This PR doesn't touch either. ### Tested Windows 11, RTX 4070 SUPER (NVIDIA 621.01), MSVC. No game files. - `ctest -R "run_tiny_first_run_ui|run_tiny_game$"`: 2/2 pass. - Negative check: with `LEONIDA_KEYBOARD_PAD=always` set by the caller, tiny_game prints `FAIL first-run UI keyboard pad reads keys only with focus`. So the check catches the old default. - `scripts/check_no_game_data.py` on the changed files: clean. AI-assisted (Claude Code). GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gta6rt --first-run-ui defaulted LEONIDA_KEYBOARD_PAD to always, so keys
typed into another program reached the title's consent pages (#1552,
hazard 1). Default to the focused mode 1; scripted presses still run
while the window is unfocused. tiny_game checks the default under
run_tiny_first_run_ui, which now clears the caller's setting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep main's first-run profile without GPU completion labels and this
branch's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:58:00 +00:00
github manually merged commit 03096929f4 into gh-pr/1612/base 2026-11-26 09:58:02 +00:00
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-25 06:27 UTC · original

Independent Windows validation at 7f08453da77d282924c09b6dc2ac51d69a369547.

CTest passed 4/4 across run_tiny_first_run_ui, run_tiny_game, gameinput, and gameinput_script. The input tests reported 364 and 10 checks respectively, all passing.

  • tiny_game confirmed that the first-run profile defaults to focused keyboard input and preserves the tested caller override.
  • With simulated keys and window focus, the GameInput suite verified that unfocused key presses are ignored, held inputs release on focus loss, and scripted input survives focus loss. Live Alt-Tab and physical keyboard behavior remain unverified.
  • The negative control explicitly set LEONIDA_KEYBOARD_PAD=always. The fixture reported the expected keyboard focus check failure and exited 1.

Windows 11 Pro 26H2 (26300.9974), MSVC 19.52.37029.0, and repository-pinned SDL 3.4.20. Used the synthetic tiny_game fixture and SDL virtual input. AI-assisted with Codex. Test coordination.

**@⁠JoeY54** on GitHub · 2026-11-25 06:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1612#issuecomment-7154816381) **Independent Windows validation** at `7f08453da77d282924c09b6dc2ac51d69a369547`. CTest passed **4/4** across `run_tiny_first_run_ui`, `run_tiny_game`, `gameinput`, and `gameinput_script`. The input tests reported 364 and 10 checks respectively, all passing. - `tiny_game` confirmed that the first-run profile defaults to focused keyboard input and preserves the tested caller override. - With simulated keys and window focus, the GameInput suite verified that unfocused key presses are ignored, held inputs release on focus loss, and scripted input survives focus loss. Live Alt-Tab and physical keyboard behavior remain unverified. - The negative control explicitly set `LEONIDA_KEYBOARD_PAD=always`. The fixture reported the expected keyboard focus check failure and exited 1. Windows 11 Pro 26H2 (26300.9974), MSVC 19.52.37029.0, and repository-pinned SDL 3.4.20. Used the synthetic `tiny_game` fixture and SDL virtual input. AI-assisted with Codex. [Test coordination](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608).
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 14:00 UTC · original

Brought up to date with main at 384abe5b0 by a merge (03096929f); no force-push. Conflicts were in runtime/src/main.cpp and docs/first_run_ui.md: main's first-run profile no longer sets LEONIDA_GPU_LABELS, and that is kept; this PR's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1) replaces main's always.

Tested on Windows 11 (RelWithDebInfo), runtime tests only, no game boot:

  • run_tiny_first_run_ui: passes
  • full ctest: 428 passed, 11 skipped and 2 disabled (game package or tools not installed here), 1 failed. The failure is xs_proxy_mock at its tear check (g_tear.reads > 0): that check is main's and untouched here; its reader thread got no reads while the machine was fully loaded by a long pipeline-cache build. Unrelated to this change.

AI-assisted (Claude Code).

**@⁠Tyrannys** on GitHub · 2026-11-25 14:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1612#issuecomment-7164602398) Brought up to date with `main` at 384abe5b0 by a merge (03096929f); no force-push. Conflicts were in `runtime/src/main.cpp` and `docs/first_run_ui.md`: main's first-run profile no longer sets `LEONIDA_GPU_LABELS`, and that is kept; this PR's focused keyboard pad (`LEONIDA_KEYBOARD_PAD=1`) replaces main's `always`. Tested on Windows 11 (RelWithDebInfo), runtime tests only, no game boot: - `run_tiny_first_run_ui`: passes - full `ctest`: 428 passed, 11 skipped and 2 disabled (game package or tools not installed here), 1 failed. The failure is `xs_proxy_mock` at its tear check (`g_tear.reads > 0`): that check is main's and untouched here; its reader thread got no reads while the machine was fully loaded by a long pipeline-cache build. Unrelated to this change. AI-assisted (Claude Code).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 19:30 UTC · original

Merged, thanks! Tested 03096929f merged onto main with the full Windows suite under Wine (llvmpipe and a RADV iGPU). The suite matches main, apart from the known timing flake in xmem (the "reader of the views' last pages" check), which this PR doesn't touch.

  • Checked on main cee965560 + 03096929f: it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass; check_no_game_data.py is clean on the 4 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 19:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1612#issuecomment-7172385887) Merged, thanks! Tested `03096929f` merged onto `main` with the full Windows suite under Wine (llvmpipe and a RADV iGPU). The suite matches `main`, apart from the known timing flake in `xmem` (the "reader of the views' last pages" check), which this PR doesn't touch. - **Checked on `main` `cee965560` + `03096929f`:** it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 4 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.