windows-boot: the keyboard pad in focus mode with an input script (BOOT-PAD-FOCUS) #1790

Open
github-bot wants to merge 1 commit from github-bot/gh-1790 into main AGit
Owner

@⁠Coderlord on GitHub · 2026-11-25 12:12 UTC · original
Coderlord:boot-pad-focus → main · +8 −5 · 4 files · 1 commits · open

Claimed in the coordination issue as: BOOT-PAD-FOCUS (#1608)

What and why

scripts/windows-boot/boot.ps1 set LEONIDA_KEYBOARD_PAD=always whenever it passed an input script, so that the
scripted presses would arrive while the game window is not focused. Scripted presses already run with or without
focus in every keyboard-pad mode (docs/gameinput.md: "Scripted presses run with or without focus for unattended
runs"; update_keyboard_pad applies them outside the focus gate), so always only added the machine's physical
keyboard and mouse from any window.

On a native boot left running while the PC was in use, that fed the person's own mouse moves (right stick), clicks
(RB) and Backspace (B) into the title: it went back a page in the first-run flow and changed the UI text size. With
LEONIDA_KEYBOARD_PAD=1 the script works the same and physical input counts only through the focused game window,
which is also how docs/gameinput.md describes playing by hand.

Also updated: the -InputScript help, the harness README's table and the comment over the script reader in
gameinput.cpp (which said the script needed always). scripts/run_guest_scene.py keeps always (a console
tool has no window of its own).

Tested

Windows 11, RTX 5080, native, retail package, ubiq main + this harness setting (set from the shell):

  • A 480 s boot with an 84-press input script under LEONIDA_KEYBOARD_PAD=1 logged exactly the 84 scripted presses
    (gameinput: press ...) and walked the first-run pages to the legal pages.
  • An earlier 600 s boot under always logged its 13 scripted presses plus 80+ unscripted ones (rsup, rsdown,
    rb, b, y) from the person using the PC, after which the title was back on the UI text size page.
  • boot.ps1 -DryRun lists LEONIDA_KEYBOARD_PAD=1 with the default script; the script parses under Windows
    PowerShell 5.1.

GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 Pro 26300

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 change)
**@⁠Coderlord** on GitHub · 2026-11-25 12:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1790) `Coderlord:boot-pad-focus` → `main` · +8 −5 · 4 files · 1 commits · open Claimed in the coordination issue as: BOOT-PAD-FOCUS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why `scripts/windows-boot/boot.ps1` set `LEONIDA_KEYBOARD_PAD=always` whenever it passed an input script, so that the scripted presses would arrive while the game window is not focused. Scripted presses already run with or without focus in every keyboard-pad mode (docs/gameinput.md: "Scripted presses run with or without focus for unattended runs"; `update_keyboard_pad` applies them outside the focus gate), so `always` only added the machine's physical keyboard and mouse from any window. On a native boot left running while the PC was in use, that fed the person's own mouse moves (right stick), clicks (RB) and Backspace (B) into the title: it went back a page in the first-run flow and changed the UI text size. With `LEONIDA_KEYBOARD_PAD=1` the script works the same and physical input counts only through the focused game window, which is also how docs/gameinput.md describes playing by hand. Also updated: the `-InputScript` help, the harness README's table and the comment over the script reader in `gameinput.cpp` (which said the script needed `always`). `scripts/run_guest_scene.py` keeps `always` (a console tool has no window of its own). ### Tested Windows 11, RTX 5080, native, retail package, ubiq `main` + this harness setting (set from the shell): - A 480 s boot with an 84-press input script under `LEONIDA_KEYBOARD_PAD=1` logged exactly the 84 scripted presses (`gameinput: press ...`) and walked the first-run pages to the legal pages. - An earlier 600 s boot under `always` logged its 13 scripted presses plus 80+ unscripted ones (`rsup`, `rsdown`, `rb`, `b`, `y`) from the person using the PC, after which the title was back on the UI text size page. - `boot.ps1 -DryRun` lists `LEONIDA_KEYBOARD_PAD=1` with the default script; the script parses under Windows PowerShell 5.1. GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 Pro 26300 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
boot.ps1 set LEONIDA_KEYBOARD_PAD=always whenever it passed an input script, so that the scripted presses arrive
while the game window is not focused. Scripted presses run with or without focus in every keyboard-pad mode
(docs/gameinput.md, update_keyboard_pad), so `always` only added the machine's physical keyboard and mouse from any
window: on a native Windows boot left running while the PC was in use, the person's mouse moves (right stick),
clicks (RB) and Backspace (B) reached the title and sent the first-run pages back a page. With
LEONIDA_KEYBOARD_PAD=1 the script works as before and physical input counts only through the focused game window.

The InputScript help, the harness README's table and the comment over the script reader say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:05:23 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 19:20 UTC · original

Reviewed 4e38cbe: checked statically (the shim builds only on Windows, no repo test covers boot.ps1, no pwsh here). LEONIDA_KEYBOARD_PAD=1 is a valid Focused value; scripted presses are written outside the focus-gated block of update_keyboard_pad on the PR base and on main's c68f49416 refactor, so a script keeps arriving unfocused, while "always" is what let RIDEV_INPUTSINK raw input reach an unfocused boot - the new default closes a real exposure and is a no-op for no-SDL3 builds (they ignore LEONIDA_KEYBOARD_PAD). One blocker for merging as is: git merge-tree reports gameinput.cpp changed in both, because the comment hunk conflicts with main's RT-INPUT-SCRIPT-NO-SDL3 rewrite (boot.ps1 and README.md apply cleanly) - please rebase and keep the corrected comment.

AI-assisted review.

Recommendation: Fix first

**@⁠PierreEbele** on GitHub · 2026-11-25 19:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1790#issuecomment-7172169913) Reviewed 4e38cbe: checked statically (the shim builds only on Windows, no repo test covers boot.ps1, no pwsh here). LEONIDA_KEYBOARD_PAD=1 is a valid Focused value; scripted presses are written outside the focus-gated block of update_keyboard_pad on the PR base and on main's c68f49416 refactor, so a script keeps arriving unfocused, while "always" is what let RIDEV_INPUTSINK raw input reach an unfocused boot - the new default closes a real exposure and is a no-op for no-SDL3 builds (they ignore LEONIDA_KEYBOARD_PAD). One blocker for merging as is: `git merge-tree` reports gameinput.cpp changed in both, because the comment hunk conflicts with main's RT-INPUT-SCRIPT-NO-SDL3 rewrite (boot.ps1 and README.md apply cleanly) - please rebase and keep the corrected comment. AI-assisted review. **Recommendation:** Fix first
github-bot force-pushed github-bot/gh-1790 from 4e38cbe9a2 to f5505665c7 2026-11-27 12:18:39 +00:00 Compare
Author
Owner

@⁠Coderlord on GitHub · 2026-11-27 12:10 UTC · original

@⁠PierreEbele thanks for the review. Rebased onto main 63185f4a3 (now f5505665c):

  • gameinput.cpp: main's RT-INPUT-SCRIPT-NO-SDL3 comment kept as it is, with only the corrected parenthetical ("with the keyboard pad on, 1 or always").
  • boot.ps1: main's :hold help text and its LEONIDA_PEEK block kept; the input-script default is LEONIDA_KEYBOARD_PAD=1, and the help says why.
  • Also runtime/README.md's LEONIDA_INPUT_SCRIPT row, which still said the keyboard pad needs always.

Checked: git diff main touches only those four lines of text plus the default, and boot.ps1 parses with no errors (PowerShell 5.1 parser). Not booted again since the rebase. AI-assisted (Claude Code).

**@⁠Coderlord** on GitHub · 2026-11-27 12:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1790#issuecomment-7217928981) @⁠PierreEbele thanks for the review. Rebased onto `main` 63185f4a3 (now f5505665c): - `gameinput.cpp`: main's RT-INPUT-SCRIPT-NO-SDL3 comment kept as it is, with only the corrected parenthetical ("with the keyboard pad on, 1 or always"). - `boot.ps1`: main's `:hold` help text and its `LEONIDA_PEEK` block kept; the input-script default is `LEONIDA_KEYBOARD_PAD=1`, and the help says why. - Also `runtime/README.md`'s `LEONIDA_INPUT_SCRIPT` row, which still said the keyboard pad needs `always`. Checked: `git diff main` touches only those four lines of text plus the default, and `boot.ps1` parses with no errors (PowerShell 5.1 parser). Not booted again since the rebase. AI-assisted (Claude Code).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/1790/head:github-bot/gh-1790'
git switch 'github-bot/gh-1790'

Merge

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