mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:05:54 +01:00
[PR #39] gameinput: GetNext/PreviousReading match the reading's kind (RT-370) #92
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#92
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/39
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/5076📝 Commits (4)
0697507gameinput: GetCurrentReading matches the reading's kind15b4924gameinput: Next/Previous readings match the requested kind3d01620gameinput: tighten the Motion history test's allowed outcomes12734e9gameinput: pin both history-walk directions and the device filter📊 Changes
3 files changed (+83 additions, -9 deletions)
View changed files
📝
docs/gameinput.md(+6 -4)📝
runtime/shims/gameinput.cpp(+20 -4)📝
runtime/test/gameinput_test.cpp(+57 -1)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claim: RT-370, https://github.com/ItsNotRexed/Leonida/issues/5032#issuecomment-7094906009 (found by
tupacfan04).Depends on:
#5053What and why
IGameInput::GetNextReading/GetPreviousReadinggo throughfind_readinginruntime/shims/gameinput.cpp, which picked the nearest reading in history by order alone. A device can advertiseGameInputKindMotionorGameInputKindRawDeviceReportbefore its readings actually carry that kind (#5053), so a Motion/Raw query could walk onto a plain-pad reading that has no such data.#5053fixed this forGetCurrentReadingby addingreading_matches(); this PR applies the same filter to the Next/Previous history walk. No new helper — it builds on#5053's, hence the dependency.Tests
Windows 11, MSVC 19.44 + Ninja, RelWithDebInfo;
gameinput_test.exeon synthetic virtual pads — 350 checks, 0 failures (no game files, no GPU used).Added the history-walk checks in
test_motion(and tightenedtest_raw_hid): both traversal directions with a Motion filter, including the device-filtered backward walk, must return only Motion readings orREADING_NOT_FOUND. This is a real negative control:with this fix:
GetPreviousReadingreturnsGAMEINPUT_E_READING_NOT_FOUND(no earlier reading carries Motion) → PASS.without the fix (reverting only
gameinput.cppand rebuilding): returnsS_OKwith a reading of kind0x01040006— no Motion bit → FAIL.All pre-existing history tests (Next/Previous ordering, device filters, horizon, unplug/replug, aggregates) still pass.
git diff --checkclean.No GPU or driver used (synthetic virtual gamepads). AI-assisted (OpenCode).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.