Input: with no device, previous and next readings walk every device in time order #361

Merged
booomxd merged 1 commit from upstream-pr/361 into main 2026-11-25 00:19:43 +00:00
booomxd commented 2026-11-24 02:35:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by booomxd on 2026-11-24T02:35:24Z.


Removes the shortcut: in relative (gameinput.rs): with no device given, GetNextReading / GetPreviousReading walked only the reference's own device.

Now, with no device, the walk covers every device's kept readings in time order, as the API documents. Readings from one poll share a timestamp, so ties go by device index, then sequence; on a single device that order is its sequence order, so walks with a device named are unchanged. REFERENCE_TOO_OLD is still decided on the reference's own device.

Test

with_no_device_readings_are_walked_across_devices_in_time_order: stand-in pad and keyboard (same poll), a host pad, a key, the pad again. Checks next/previous across all of them in both directions, the gamepad-only filter skipping keyboard readings, and that naming a device still keeps the walk on it.

cargo test -p victory-hle gameinput: 8 passed. cargo clippy -p victory-hle --all-targets: clean. Not run in-game; Grand Theft Auto VI's own walks (keyboard only, current pad's previous) behave as before.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6573335673 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/361). Originally posted by [booomxd](https://github.com/booomxd) on 2026-11-24T02:35:24Z. --- Removes the `shortcut:` in `relative` (`gameinput.rs`): with no device given, `GetNextReading` / `GetPreviousReading` walked only the reference's own device. Now, with no device, the walk covers every device's kept readings in time order, as the API documents. Readings from one poll share a timestamp, so ties go by device index, then sequence; on a single device that order is its sequence order, so walks with a device named are unchanged. `REFERENCE_TOO_OLD` is still decided on the reference's own device. ### Test `with_no_device_readings_are_walked_across_devices_in_time_order`: stand-in pad and keyboard (same poll), a host pad, a key, the pad again. Checks next/previous across all of them in both directions, the gamepad-only filter skipping keyboard readings, and that naming a device still keeps the walk on it. `cargo test -p victory-hle gameinput`: 8 passed. `cargo clippy -p victory-hle --all-targets`: clean. Not run in-game; Grand Theft Auto VI's own walks (keyboard only, current pad's previous) behave as before.
jeremygold02 commented 2026-11-24 06:55:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:27:25Z.


Tested PR #361 at head 3f5eff57603270823920e15b93479dc168b08eb9 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at 3f5eff57603270823920e15b93479dc168b08eb9.

  • cargo test --locked -p victory-hle with_no_device_readings_are_walked_across_devices_in_time_order — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 86 filtered out; finished in 0.01s ); cases: modules::gameinput::tests::with_no_device_readings_are_walked_across_devices_in_time_order.

Behavior covered: Checks controller readings walk all devices in timestamp order when no device is selected.
Code: crates/victory-hle/src/modules/gameinput.rs

<!-- greyfinch-sync:Marvisak/VIctory:comment:7122036273 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/361#issuecomment-7122036273). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:27:25Z. --- Tested PR #361 at head `3f5eff57603270823920e15b93479dc168b08eb9` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `3f5eff57603270823920e15b93479dc168b08eb9`. - `cargo test --locked -p victory-hle with_no_device_readings_are_walked_across_devices_in_time_order` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 86 filtered out; finished in 0.01s ); cases: modules::gameinput::tests::with_no_device_readings_are_walked_across_devices_in_time_order. Behavior covered: Checks controller readings walk all devices in timestamp order when no device is selected. Code: [crates/victory-hle/src/modules/gameinput.rs](https://github.com/Marvisak/VIctory/blob/3f5eff57603270823920e15b93479dc168b08eb9/crates/victory-hle/src/modules/gameinput.rs)
upstream-sync closed this pull request 2026-11-25 01:03:30 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!361
No description provided.