Mouse and keyboard: bindings read again after KEY BINDINGS, also after a file that did not read #1185
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1185"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T15:09:03Z.
What happens
bindings.iniasks to be edited by hand ("Edit while the game is closed…"). With a typo in it, for exampleRT = LeftClickinstead ofMouse1,parserefuses the file. The start then saysMouse and keyboard disabled: Invalid binding on line …, and mouse and keyboard are off.The natural fix is F1, KEY BINDINGS: pick the line and press the key. That writes a good file, bumps
MNK_BINDINGS_CHANGED, and the menu says "SAVED TO BINDINGS.INI AND USED AT ONCE." Butconfig()read the file again only when the earlier read had worked:So mouse and keyboard stayed off until a restart.
The change (
crates/victory-hle/src/modules/mnk.rs)refresh(state, changed, load), whichconfig()calls with its static, the write count andload. That lets the rule be tested without the file or the globals.Some(_). The file is read again whenever the write count moved, whatever the last read gave.enabled()andsample()callconfig()each time, so the bindings are in use at once, as the menu says.The menu's side needs nothing. It writes the key names that
key()reads back (letters and digits, the named keys,0x..for the rest).Tests
New
bindings_are_read_again_after_a_write_even_after_a_file_that_did_not_read:RTonMouse1);Some(Some(_))arm it fails, at the read after the write.cargo test -p victory-hle --locked: 191 passed, 3 ignored, plus the other test binaries.Clippy (
-p victory-hle --all-targets -D warnings, default and--all-features): clean. That is with main's three findings allowed (let_and_return,manual_is_multiple_of,some_filter), which #665 fixes.Checked independently by jptorres96 on Windows 11 26300 (rustc 1.98.1):
cargo test -p victory-hle --lib191 passed, including the new test. Clippy: nothing inmnk.rs.Not run with the game.
No game files, dumps or extracted data are included.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jptorres96 on 2026-11-28T17:19:16Z.
Checked at
pr1185(on9ce3cf9), Windows build 26300, rustc 1.98.1:cargo test -p victory-hle --lib: 191 passed, includingbindings_are_read_again_after_a_write_even_after_a_file_that_did_not_read.cargo clippy -p victory-hle --all-targets --no-deps -- -D warnings: nothing inmnk.rs. The one finding ismain's ownsome_filteratgameinput.rs:1383.I found the same thing reading
4715a42..f4608f0, andSome(_)inrefreshis the whole fix for it.A separate question on the same feature, not for this PR. With
VICTORY_MNK=1,Host::xinputreturnsNonefor every slot (if super::mnk::enabled() { return None; },gameinput.rs~1303). A controller that is plugged in is then ignored for as long as mouse and keyboard are on, and switching back means F1 and a restart. If that is meant, to keep a resting stick from fighting the mouse, fine. If not, a pad that reports input could take precedence over the keyboard stand-in, with mouse and keyboard used when it is idle, and players with both could switch without a restart.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T17:45:29Z.
Thanks for checking it on 26300, and for reading the range independently.
On
Host::xinputreturningNonewhile mouse and keyboard are on: that's the feature's own design, not something this PR touches, so it's the maintainer's call. Your suggestion makes sense to me, though: let a pad that reports input win, and fall back to mouse and keyboard while it's idle. Players with both could then switch without F1 and a restart. Worth an issue of its own if it isn't meant.