mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1074] [MERGED] gameinput: keyboard pad input scripts of any length (RT-INPUT-SCRIPT-LENGTH) #1112
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#1112
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/1074
Author: @Moriz82
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:split/rt-input-script-length📝 Commits (1)
f9ba70bgameinput: keyboard pad input scripts of any length (RT-INPUT-SCRIPT-LENGTH)📊 Changes
4 files changed (+115 additions, -11 deletions)
View changed files
📝
docs/gameinput.md(+4 -3)📝
runtime/CMakeLists.txt(+3 -1)📝
runtime/shims/gameinput.cpp(+73 -6)📝
runtime/test/gameinput_test.cpp(+35 -1)📄 Description
Claimed in the coordination issue as: RT-INPUT-SCRIPT-LENGTH (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 contains the integration. #955 changes physical
right-stick keys and controller hotplug in the same shim.
What and why
Main had no scheduler for keyboard pad input scripts. This change reads
LEONIDA_INPUT_SCRIPTand schedules comma-separatedbutton@secondsentries. The shared environment reader now reads every
LEONIDA_*setting used by this shim at full length. Previously, values of 64
characters or more read as unset.
The first keyboard pad update reads the script and starts its clock.
Each scheduled press lasts 300 ms and works with or without focus. A
physical key or another active scheduled press can keep a button held.
reload_config()leaves the startup script in effect.Spaces around an entry are allowed. Empty entries, unknown buttons and
missing, malformed, negative or non-finite times are ignored. The shim
logs the accepted and rejected counts for each nonempty script. Leave
the variable unset to disable scheduling.
Tested
Release cross-build with clang-cl 23.1.5 and an xwin SDK on CachyOS,
kernel 7.3.5. The tests used Proton Experimental (Wine 11), a Ryzen 5
5600X, 16 GB RAM and SDL virtual joysticks. The host had an RTX 4070
12 GB with NVIDIA 620.73.04. CMake omitted the optional XMA2 decoder
because the Rust Windows target was unavailable.
The 135-byte fixture places X at byte offset 67, padded with whitespace,
and schedules X again later. It supplies an unknown button, missing and
invalid times, empty items and a whitespace-only item. Physical B and
scripted X are held on the first reading. After losing focus and
reloading with a different script, only X is held. Once the original
press expires and focus returns, only B is held.
The default run passed 364/364 checks. The focused run passed 10/10 and
reported eight scheduled entries and eleven rejected entries.
Both controls used the same test object and link settings. For the
reader control, restore only
env()from the commit's parent. For theparser control, restore only the pre-review parsing loop with its
unchecked time conversion. Run each control with
--input-script.Each fraction counts passing checks. Only the child ran the default
suite. The old parser counted 14 entries as valid.
Both
gameinputandgameinput_scriptappeared disabled without SDL3and enabled again after restoring SDL3. The documentation suite passed
4/4 tests. The semantic suite passed 6,168 tests in 470 files. The
content and whitespace checks passed.
A contributor tested the pre-review scheduler on native Windows 11.
All 14/14 runs passed at lengths from 63 to 4,096 bytes. With only the
old reader restored, both 63-byte runs passed and all 12/12 longer runs
missed the scheduled presses. Native Windows has not been rerun on this
revision. AMD, Intel, a physical controller and a game boot were not
tested on this revision.
GPUs tested: none. The GameInput tests use synthetic input.
AI-assisted: yes
Checklist
bd8d72bb2, verified to merge cleanly into955d9be34.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.