hle(gameinput): input latch and stick dead zone for play at a few frames a second (#429) #435
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!435
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-431"
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?
@marcus-4 on GitHub · 2026-11-27 17:57 UTC · original
marcus-4:feat/input-latch-dead-zone→main· +377 −6 · 3 files · 1 commits · closed without mergingWhat this changes
Refs #433
Two input switches for play at a few frames a second, both off by default, ported from halfwave50/VIctory-macOS-halfwave50 (GPL-3.0) commits
52e0325andf01d73eby halfwave50, into a child modulecrates/victory-hle/src/modules/gameinput_slow.rs:VICTORY_INPUT_LATCH=1: a button change the title has not seen yet waits for its next reading, so a tap between two of the title's once-a-frame readings is seen once. Triggers show their peak since the last reading, sticks their latest value; readings within 15 ms agree; with no reading for 2 s the latch lets go.VICTORY_STICK_DEADZONE=<share>: a round dead zone per host pad stick, the rest of the travel spread over 0 to 1.Hooks in
gameinput.rs:Slow::latchinState::pollfor the host pads and the keyboard's stand-in pad;Slow::handedafter a successfulcurrent_readingandtemporal_reading;Slow::dead_zonesinHub::pollbefore scripted keys are merged. Documented indocs/native-host.mdnext toVICTORY_KEYS. halfwave50's Wine-onlyVICTORY_INPUT_REFOCUSis not ported:window.rsreleases keys when the window loses key status.How it was tested
M1 Pro, macOS 27.2.1, Xcode 27.2.
cargo test --target x86_64-apple-darwin -p victory-hle -p victory: 368 passed, 0 failed (arm64: 162 passed, 0 failed). New: halfwave50's five unit tests ingameinput_slow.rs(a second press before the release was seen, reads close together agree, a latch nobody reads lets go, the dead zone, trigger peaks), andlatch_shows_a_tap_between_readings_once_and_held_buttons_while_held, end to end throughGetCurrentReadingwith the fake host: with the switch off the tap is lost, with it on it is seen once.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: clean.cargo xtask policy: ok.Checklist
VICTORY_*variable and documentedbcde46b6d6to2984e3308b2984e3308bto1226455d681226455d68to3ecea3e862@marcus-4 on GitHub · 2026-11-28 08:13 UTC · original
Closing: this change has been redone on a newer base.
Pull request closed