Skip to content

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

Merged
aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
Tyrannys:first-run-pad-focus
Nov 25, 2026
Merged

aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
Tyrannys:first-run-pad-focus

Conversation

@Tyrannys

@Tyrannys Tyrannys commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

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

…-FIRST-RUN-PAD-FOCUS)

gta6rt --first-run-ui defaulted LEONIDA_KEYBOARD_PAD to always, so keys
typed into another program reached the title's consent pages (ProjectLeonida#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 <noreply@anthropic.com>
@JoeY54

JoeY54 commented Nov 25, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
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 <noreply@anthropic.com>
@Tyrannys

Tyrannys commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Brought up to date with main at 384abe5 by a merge (0309692); 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).

@aslan2142
aslan2142 merged commit e18b59a into ProjectLeonida:main Nov 25, 2026
2 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants