mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1528] make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX) #1555
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1555
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
d4d969amake_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX)e6aa63bdocs: wrap the keyboard pad settings descriptiond215808Merge main into input-out-of-the-box: the input script row from #1843 with the keyboard pad on by default53ab2c9Merge upstream main into input-out-of-the-box99f913aMerge upstream main into input-out-of-the-box7ffcb8eMerge 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 ranscripts/build_runtime.ps1 -Jobs Nwithout-FetchSdl3. So on a machine without an installed SDL3, the GameInput shim was not built, andgta6rtloggedgameinput: 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=ONand settingLEONIDA_KEYBOARD_PAD=1made 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 inruntime/CMakeLists.txtonce and checks its SHA-256. An installed SDL3 is still preferred.--no-sdl3leaves the download out. The module docstring's sentence about what the script downloads now names SDL3.runtime/shims/gameinput.cpp:LEONIDA_KEYBOARD_PADdefaults 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.offor0removes the pad,alwaysis unchanged, and an unknown value still turns it off with a message.runtime/test/gameinput_test.cpp:mainsetsLEONIDA_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 thatoffremoves the pad.docs/gameinput.md: the default and whatmake_game.pydoes.Tested (Windows 11 Pro 26300, MSVC 19.50, VS 2026 generator, native)
ctest -R '^gameinput$'andgameinput_scriptpass 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 1withsdl3=False;run_build_stages(..., sdl3=False)reachesruntime().tests/test_make_game_argparse.py(38 OK) andtests/test_leonida_tui.py(25 OK).f78385646built with SDL3. I ran it withLEONIDA_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.