Repository navigation
make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX) - #1528
Open
kawaii-shakal wants to merge 6 commits into
Open
make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX)#1528kawaii-shakal wants to merge 6 commits into
kawaii-shakal wants to merge 6 commits into
Conversation
… box (INPUT-OUT-OF-THE-BOX) 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 <noreply@anthropic.com>
4 tasks done
Contributor
|
[KEEP]
|
This was referenced Nov 25, 2026
AI-assisted by Codex.
…ctLeonida#1843 with the keyboard pad on by default
Keep the PR keyboard-pad default and document the retry behavior from main. Conflict resolution assisted by Codex.
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim: #14 (comment) (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