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

Closed
opened 2026-11-26 20:21:54 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1612
Author: @Tyrannys
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: first-run-pad-focus


📝 Commits (2)

  • 7f08453 runtime: the first-run UI keyboard pad reads keys only with focus (RT-FIRST-RUN-PAD-FOCUS)
  • 0309692 Merge main into first-run-pad-focus

📊 Changes

4 files changed (+6 additions, -3 deletions)

View changed files

📝 docs/first_run_ui.md (+1 -1)
📝 runtime/CMakeLists.txt (+1 -1)
📝 runtime/src/main.cpp (+3 -1)
📝 runtime/test/fixtures/tiny_game.cpp (+1 -0)

📄 Description

Claimed in the coordination issue as: RT-FIRST-RUN-PAD-FOCUS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154210350)

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1612 **Author:** [@Tyrannys](https://github.com/Tyrannys) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `first-run-pad-focus` --- ### 📝 Commits (2) - [`7f08453`](https://github.com/ubiquitarianism/leonida/commit/7f08453da77d282924c09b6dc2ac51d69a369547) runtime: the first-run UI keyboard pad reads keys only with focus (RT-FIRST-RUN-PAD-FOCUS) - [`0309692`](https://github.com/ubiquitarianism/leonida/commit/03096929f42f6f1fdc687868fd9f9589e48a4b97) Merge main into first-run-pad-focus ### 📊 Changes **4 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/first_run_ui.md` (+1 -1) 📝 `runtime/CMakeLists.txt` (+1 -1) 📝 `runtime/src/main.cpp` (+3 -1) 📝 `runtime/test/fixtures/tiny_game.cpp` (+1 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-FIRST-RUN-PAD-FOCUS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154210350) ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:21:54 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1627
No description provided.