menu: allow keyboard input on certain menus #448
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!448
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-448"
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?
@PoleTransformer on GitHub · 2026-12-04 07:40 UTC · original
PoleTransformer:input_submenu→main· +26 −1 · 1 files · 4 commits · openFixes controls(A and B) dont work in certain menus. I've experienced this in the game save override menu and in gameplay menus during missions.
Likely related to this issue: #383
Logs captured during gameplay:
Pressing escape on keyboard to pause:
Entering game save override menu:
The oracle here is bit 4 is still active in the override save menu, while bit 2 toggles to 0.
In gameplay menu during storyline:
Upon entering the scripted scene,
input context changedis fired:After pressing Enter on keyboard in that gameplay menu to confirm repair:
In both cases bit 2 is false, while bit 4 remains true.
@Kal0s-design on GitHub · 2026-12-04 08:00 UTC · original
Had a read through this one (head
24db9bf).What it changes. Only
resolve_active_sourcesin keyboard_events.rs (1030-1044). Before, an action counted only if +0x158 had the 0x2 bit. Now, whilein_menu_nowsays we're in a menu, 0x2 or 0x8 is enough. Outside menus nothing changes. This is the keyboard/mouse to pad translation path only, so a real controller's A/B never goes through it. I read the A/B in the description as the keys that end up as A/B (Enter, Esc, clicks).Things I checked that look fine
apply_release, 1216), not by re-resolving, so whatever got pressed gets released. Menu enter/exit still runsrelease_all_heldandpress_again(watch_menus, 482-484).translatewhenvictory_core::menu::is_open()(70-79), and that's untouched.press_again(684),retranslate_held(795) andtranslate(1183). press_again only runs after leaving a menu (484), so it mostly keeps the old rule. The other two get the wider rule whenever the menu check is true.Things I'd look at before merging
translatetries the menu list first and then the play list (1114-1119). With this change, any play action that has 0x8 set can now fire in a menu, and before it couldn't. Keys with an empty menu list are the easy case (T, Y, U, I, J, K, L, F9, F10 in native-keys.default.txt). Before, they did nothing in the pause menu. Now they send their play action's pad button if that action has 0x8 set.in_menu_nowis already true, and that needs one of MENU_ACTIONS to have 0x2 set (361-381). If the save override menu doesn't meet that, this branch never runs there. A log line from that menu would settle it (the "input context changed" one with menu=true and the menu_actions list, 461-473).in_menu_nowis called inside the loop, once per matching action, and each call scans the whole action array again. It'd be cheaper to work it out once before the loop. It also doesn't account for IN_WHEEL, whiletranslatedoes (1108). Passingin_menuin from the caller would keep the two in sync. The newifalso isn't rustfmt-formatted, though main isn't fmt-clean either.A narrower version would keep 0x2 as the first pass over the whole list, and only when nothing matches, do a second pass over the menu list alone that accepts 0x8. Normal menus would behave exactly as before, and play actions could never fire in a menu.
Tests.
cargo test -p victory-loader --libon the PR head, run natively on Windows (MSVC, not Wine): 84 passed, 0 failed. The changed logic reads live memory and isn't a pure function, so I didn't add tests for it. Not tested in game.AI-assisted: yes
@Luxuride on GitHub · 2026-12-04 11:28 UTC · original
The bit's meaning is the whole PR, and the only recorded evidence in the tree says the opposite:
crates/victory-loader/src/keyboard_events.rs:157-158notes0x0ain play and0x08in a menu forPLAY_ACTION— i.e.8is what an action reads while a menu is suppressing it, not a mark of "this menu wants keyboard". If that generalises,state & (2 | 8)is true for nearly every action whenever a menu is up. Please attach a+0x158dump from the save-override menu (and an ordinary pause menu) showing8selects only the actions you mean.Also: the comment at
keyboard_events.rs:1032says "bit 3" for& 8; this file numbers bits one-based (:1070pairs "bit 2" with& 2), so pick one. Andin_menu_now(base)walks the whole action table — hoist it above thefor &id in actionsloop the wayin_plane_nowis hoisted at:1019-1021.Partly superseded:
50861c5already fixed footer confirmation dialogs via bindings (:1772-1794). If #383's menus are those footers this cannot help; if they are the save-override and story menus, say so — it is worth knowing which case still reproduces.menu: allow input on certain menusto menu: allow keyboard input on certain menusView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.