make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX) #1528

Open
github-bot wants to merge 6 commits from github-bot/gh-1528 into main AGit
Owner

@⁠kawaii-shakal on GitHub · 2026-11-25 03:31 UTC · original
kawaii-shakal:input-out-of-the-box → main · +66 −32 · 7 files · 6 commits · open

Claim: #14 (INPUT-OUT-OF-THE-BOX)

What and why

On Windows, a build made the usual way (make_game.py / Build.bat) had no input at all. The runtime stage ran scripts/build_runtime.ps1 -Jobs N without -FetchSdl3. So on a machine without an installed SDL3, the GameInput shim was not built, and gta6rt logged gameinput: served without SDL3 (no devices; E_NOTIMPL for every other slot). I hit this on the retail boot: the title reached its account-selection screen, and a connected DualSense did nothing. Rebuilding with -DLEONIDA_SDL3_FETCH=ON and setting LEONIDA_KEYBOARD_PAD=1 made both the DualSense and the keyboard work. This PR makes that the default.

  • make_game.py: the Windows runtime stage passes -FetchSdl3. CMake then downloads the SDL3 3.4.20 release pinned in runtime/CMakeLists.txt once and checks its SHA-256. An installed SDL3 is still preferred. --no-sdl3 leaves the download out. The module docstring's sentence about what the script downloads now names SDL3.
  • runtime/shims/gameinput.cpp: LEONIDA_KEYBOARD_PAD defaults to the focused mode. The title reads gamepads only, so before this a player without a pad could not press anything. Keys and the mouse count only while a window of the process has focus, and the cursor clip and release on focus loss work as before. off or 0 removes the pad, always is unchanged, and an unknown value still turns it off with a message.
  • runtime/test/gameinput_test.cpp: main sets LEONIDA_KEYBOARD_PAD=off, because the other cases count only their own virtual pads. The keyboard-pad case now checks that the default is the focused mode and that off removes the pad.
  • docs/gameinput.md: the default and what make_game.py does.

Tested (Windows 11 Pro 26300, MSVC 19.50, VS 2026 generator, native)

  • ctest -R '^gameinput$' and gameinput_script pass with SDL3 3.4.20. With the test change reverted, the new default breaks the old expectations (no gamepads before any is attached, ...), so the test change is needed and covers the default.
  • tests/test_make_game_platform.py (47 OK): the Windows runtime command ends in -Jobs 1 -FetchSdl3, and in -Jobs 1 with sdl3=False; run_build_stages(..., sdl3=False) reaches runtime(). tests/test_make_game_argparse.py (38 OK) and tests/test_leonida_tui.py (25 OK).
  • Retail boot on an RTX 5070 Ti (driver 617.42), main f78385646 built with SDL3. I ran it with LEONIDA_KEYBOARD_PAD=1, which is exactly the mode this PR makes the default; I have not booted this branch's own build. The DualSense came up as player 1 (connected DualSense Wireless Controller (054c:0ce6, player 1, DualSense trigger effects, gyro)) and the keyboard pad as player 2. Both moved the title past its account-selection screen to the loading screen.

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

🤖 Generated with Claude Code

**@⁠kawaii-shakal** on GitHub · 2026-11-25 03:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1528) `kawaii-shakal:input-out-of-the-box` → `main` · +66 −32 · 7 files · 6 commits · open Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 (INPUT-OUT-OF-THE-BOX) ### What and why On Windows, a build made the usual way (`make_game.py` / `Build.bat`) had **no input at all**. The runtime stage ran `scripts/build_runtime.ps1 -Jobs N` without `-FetchSdl3`. So on a machine without an installed SDL3, the GameInput shim was not built, and `gta6rt` logged `gameinput: served without SDL3 (no devices; E_NOTIMPL for every other slot)`. I hit this on the retail boot: the title reached its account-selection screen, and a connected DualSense did nothing. Rebuilding with `-DLEONIDA_SDL3_FETCH=ON` and setting `LEONIDA_KEYBOARD_PAD=1` made both the DualSense and the keyboard work. This PR makes that the default. - `make_game.py`: the Windows runtime stage passes `-FetchSdl3`. CMake then downloads the SDL3 3.4.20 release pinned in `runtime/CMakeLists.txt` once and checks its SHA-256. An installed SDL3 is still preferred. `--no-sdl3` leaves the download out. The module docstring's sentence about what the script downloads now names SDL3. - `runtime/shims/gameinput.cpp`: `LEONIDA_KEYBOARD_PAD` defaults to the focused mode. The title reads gamepads only, so before this a player without a pad could not press anything. Keys and the mouse count only while a window of the process has focus, and the cursor clip and release on focus loss work as before. `off` or `0` removes the pad, `always` is unchanged, and an unknown value still turns it off with a message. - `runtime/test/gameinput_test.cpp`: `main` sets `LEONIDA_KEYBOARD_PAD=off`, because the other cases count only their own virtual pads. The keyboard-pad case now checks that the default is the focused mode and that `off` removes the pad. - `docs/gameinput.md`: the default and what `make_game.py` does. ### Tested (Windows 11 Pro 26300, MSVC 19.50, VS 2026 generator, native) - `ctest -R '^gameinput$'` and `gameinput_script` pass with SDL3 3.4.20. With the test change reverted, the new default breaks the old expectations (`no gamepads before any is attached`, ...), so the test change is needed and covers the default. - `tests/test_make_game_platform.py` (47 OK): the Windows runtime command ends in `-Jobs 1 -FetchSdl3`, and in `-Jobs 1` with `sdl3=False`; `run_build_stages(..., sdl3=False)` reaches `runtime()`. `tests/test_make_game_argparse.py` (38 OK) and `tests/test_leonida_tui.py` (25 OK). - Retail boot on an RTX 5070 Ti (driver 617.42), main `f78385646` built with SDL3. I ran it with `LEONIDA_KEYBOARD_PAD=1`, which is exactly the mode this PR makes the default; I have not booted this branch's own build. The DualSense came up as player 1 (`connected DualSense Wireless Controller (054c:0ce6, player 1, DualSense trigger effects, gyro)`) and the keyboard pad as player 2. Both moved the title past its account-selection screen to the loading screen. AI-assisted: yes (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A build made with make_game.py on Windows had no input at all. The runtime
stage ran scripts/build_runtime.ps1 without -FetchSdl3, so on a machine without
an installed SDL3 the GameInput shim was not built. gta6rt then logged "served
without SDL3 (no devices)", and a connected DualSense or Xbox pad did nothing.

- make_game.py: the Windows runtime stage passes -FetchSdl3 (the pinned SDL3
  3.4.20, SHA-256 checked by CMake). --no-sdl3 leaves the download out. The
  docstring's "what it downloads" sentence names it.
- gameinput: LEONIDA_KEYBOARD_PAD defaults to the focused mode, so a player
  without a pad still has the keyboard and mouse. Keys count only while the
  game window has focus. "off" or "0" removes the pad.
- gameinput_test: the other cases set LEONIDA_KEYBOARD_PAD=off, as they count
  only their own virtual pads. The keyboard pad case checks the new default.
- docs/gameinput.md: default and make_game behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AI-assisted by Codex.
Keep the PR keyboard-pad default and document the retry behavior from main.

Conflict resolution assisted by Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:55:27 +00:00
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:34 UTC · original · edited 2026-11-25 03:45 UTC

[KEEP]

  • Scope is coherent (make_game.py, runtime/shims/gameinput.cpp, gameinput_test.cpp, docs/gameinput.md), the PR is mergeable, but CI is still pending (windows, macos, linux-gpu-tools, no-game-data, change-scope); the Windows leg is the one that exercises the changed gameinput test, so please wait for it to go green.
  • Two defaults change at once: LEONIDA_KEYBOARD_PAD goes from off to focused, and make_game.py now downloads SDL3 on Windows unless --no-sdl3 is passed. Both are user-visible and the second adds a network download, so this needs an explicit maintainer decision rather than a drive-by merge.
  • #1510 also edits runtime/shims/gameinput.cpp and gameinput_test.cpp; hunks do not currently overlap, but whichever lands second should be rebased and re-checked.
  • Minor: the rewritten paragraphs in docs/gameinput.md (Keyboard pad section and the "By default (or with ...)" line) exceed the file's ~120-column wrap.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1528#issuecomment-7152036795) · edited 2026-11-25 03:45 UTC **[KEEP]** - Scope is coherent (`make_game.py`, `runtime/shims/gameinput.cpp`, `gameinput_test.cpp`, `docs/gameinput.md`), the PR is mergeable, but CI is still pending (`windows`, `macos`, `linux-gpu-tools`, `no-game-data`, `change-scope`); the Windows leg is the one that exercises the changed gameinput test, so please wait for it to go green. - Two defaults change at once: `LEONIDA_KEYBOARD_PAD` goes from off to focused, and `make_game.py` now downloads SDL3 on Windows unless `--no-sdl3` is passed. Both are user-visible and the second adds a network download, so this needs an explicit maintainer decision rather than a drive-by merge. - #1510 also edits `runtime/shims/gameinput.cpp` and `gameinput_test.cpp`; hunks do not currently overlap, but whichever lands second should be rebased and re-checked. - Minor: the rewritten paragraphs in `docs/gameinput.md` (Keyboard pad section and the "By default (or with ...)" line) exceed the file's ~120-column wrap.
docs/gameinput.md conflicted on two passages, both kept:
- main's new LEONIDA_INPUT_FILE paragraph, with this branch's sentence on
  make_game.py running build_runtime.ps1 with -FetchSdl3 (and --no-sdl3)
  added to main's wording of the build paragraph;
- the settings table keeps this branch's LEONIDA_KEYBOARD_PAD default (1,
  focused; off removes it), which gameinput.cpp reads, and takes main's longer
  LEONIDA_INPUT_SCRIPT row (button@seconds:hold, the six-reads rule), saying
  "on unless LEONIDA_KEYBOARD_PAD=off" for the keyboard pad.

No code conflicted. Tested: full ctest, 113 of 113, on Linux (the portable
subset; the gameinput shim is Windows-only).

Changes made by Claude Code (AI-assisted).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
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/1528/head:github-bot/gh-1528'
git switch 'github-bot/gh-1528'

Merge

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