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

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1528
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: input-out-of-the-box


📝 Commits (6)

  • d4d969a make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX)
  • e6aa63b docs: wrap the keyboard pad settings description
  • d215808 Merge main into input-out-of-the-box: the input script row from #1843 with the keyboard pad on by default
  • 53ab2c9 Merge upstream main into input-out-of-the-box
  • 99f913a Merge upstream main into input-out-of-the-box
  • 7ffcb8e Merge upstream/main into input-out-of-the-box

📊 Changes

7 files changed (+66 additions, -32 deletions)

View changed files

📝 docs/gameinput.md (+15 -11)
📝 make_game.py (+15 -8)
📝 runtime/shims/gameinput.cpp (+7 -4)
📝 runtime/shims/gameinput.h (+1 -1)
📝 runtime/test/gameinput_test.cpp (+10 -4)
📝 tests/test_make_game_argparse.py (+1 -1)
📝 tests/test_make_game_platform.py (+17 -3)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151877988 (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


🔄 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/1528 **Author:** [@kawaii-shakal](https://github.com/kawaii-shakal) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `input-out-of-the-box` --- ### 📝 Commits (6) - [`d4d969a`](https://github.com/ubiquitarianism/leonida/commit/d4d969a1fdc4bf8026017ab52d0a5d03c7737be6) make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX) - [`e6aa63b`](https://github.com/ubiquitarianism/leonida/commit/e6aa63b187246f62acfe249b7ac177a5ef8f7bef) docs: wrap the keyboard pad settings description - [`d215808`](https://github.com/ubiquitarianism/leonida/commit/d2158084cc6659aa6f149fd3ae2511d1402f3d57) Merge main into input-out-of-the-box: the input script row from #1843 with the keyboard pad on by default - [`53ab2c9`](https://github.com/ubiquitarianism/leonida/commit/53ab2c96666102822fc6c865af472279c8a8bbdc) Merge upstream main into input-out-of-the-box - [`99f913a`](https://github.com/ubiquitarianism/leonida/commit/99f913a2883b6416385790dd3861b3890e142cb0) Merge upstream main into input-out-of-the-box - [`7ffcb8e`](https://github.com/ubiquitarianism/leonida/commit/7ffcb8e260d3cedfb0077d924b0be189293c5a2c) Merge upstream/main into input-out-of-the-box ### 📊 Changes **7 files changed** (+66 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `docs/gameinput.md` (+15 -11) 📝 `make_game.py` (+15 -8) 📝 `runtime/shims/gameinput.cpp` (+7 -4) 📝 `runtime/shims/gameinput.h` (+1 -1) 📝 `runtime/test/gameinput_test.cpp` (+10 -4) 📝 `tests/test_make_game_argparse.py` (+1 -1) 📝 `tests/test_make_game_platform.py` (+17 -3) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151877988 (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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1555
No description provided.