input: no controller-disconnected screen on keyboard; wheel, binoculars and camera in scripted scenes #254

Manually merged
github merged 8 commits from github-bot/gh-254 into main 2026-12-02 22:49:42 +00:00 AGit
Owner

@⁠prinzjo on GitHub · 2026-12-02 21:54 UTC · original
prinzjo:pr/input → main · +461 −91 · 3 files · 8 commits · merged 2026-12-02 22:44 UTC

Keyboard and mouse fixes for playing without a working controller. Upstream does not have any of these yet (#94 was merged, but its merge did not survive the rebuild of main).

Controller-disconnected screen (root cause found and reproduced)

  • Any pad event the key relay sent outside a key's own keyboard event made the title show "CONTROLLER DISCONNECTED" within 50 ms. It stayed while the key was held. The stray events came from the steering ramp's steps (sent by the menu watch thread), keys pressed again after a menu, and vehicle re-mapping.
  • Reproduced in the first mission's boat with keys fed from a file (VICTORY_KEYS_FILE, diagnostics builds). W held, then W+D: 5-9 screens per three rounds before, 0 in 9 rounds after. Pause and resume with W held: before, a screen stuck until W was released; after, none.
  • Fix: the steering ramp lives only in the stand-in pad's reading (the title steers by it). Other events made outside a key event wait and go out ahead of the next key's events.
  • Releases when entering a menu still go out at once, so a key held into the pause menu doesn't act there.
  • Held sticks and triggers are also mirrored into the stand-in pad's reading, so the title doesn't switch to the keyboard as the active device while a key is held.

Weapon wheel, binoculars, camera

  • Scripted scenes turn walking off, which read as "menu", so the mouse stepped through menus instead of driving the wheel or looking around. Now a menu means walking off and one of the menu's own actions on.
  • The wheel's own actions count as "wheel open" only after a wheel key opened it. At the binoculars tutorial the title turns them on before any wheel is open, and a slight mouse move then spun the camera nonstop.
  • In play the arrow keys are the stand-in pad's d-pad (binocular zoom), and keys still down after a menu are pressed again.

The gameinput tests that fail on clean main (3) fail the same way here; publish::tests::concurrent_publishers_do_not_share_a_staging_file is flaky on clean main too.

Co-Authored-By: Claude Opus 5.5 [email protected]

**@⁠prinzjo** on GitHub · 2026-12-02 21:54 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/254) `prinzjo:pr/input` → `main` · +461 −91 · 3 files · 8 commits · merged 2026-12-02 22:44 UTC Keyboard and mouse fixes for playing without a working controller. Upstream does not have any of these yet (#94 was merged, but its merge did not survive the rebuild of main). **Controller-disconnected screen (root cause found and reproduced)** - Any pad event the key relay sent outside a key's own keyboard event made the title show "CONTROLLER DISCONNECTED" within 50 ms. It stayed while the key was held. The stray events came from the steering ramp's steps (sent by the menu watch thread), keys pressed again after a menu, and vehicle re-mapping. - Reproduced in the first mission's boat with keys fed from a file (`VICTORY_KEYS_FILE`, diagnostics builds). W held, then W+D: 5-9 screens per three rounds before, 0 in 9 rounds after. Pause and resume with W held: before, a screen stuck until W was released; after, none. - Fix: the steering ramp lives only in the stand-in pad's reading (the title steers by it). Other events made outside a key event wait and go out ahead of the next key's events. - Releases when entering a menu still go out at once, so a key held into the pause menu doesn't act there. - Held sticks and triggers are also mirrored into the stand-in pad's reading, so the title doesn't switch to the keyboard as the active device while a key is held. **Weapon wheel, binoculars, camera** - Scripted scenes turn walking off, which read as "menu", so the mouse stepped through menus instead of driving the wheel or looking around. Now a menu means walking off *and* one of the menu's own actions on. - The wheel's own actions count as "wheel open" only after a wheel key opened it. At the binoculars tutorial the title turns them on before any wheel is open, and a slight mouse move then spun the camera nonstop. - In play the arrow keys are the stand-in pad's d-pad (binocular zoom), and keys still down after a menu are pressed again. The gameinput tests that fail on clean main (3) fail the same way here; `publish::tests::concurrent_publishers_do_not_share_a_staging_file` is flaky on clean main too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The input context said "menu" whenever INPUT_MOVE_UP_ONLY was inactive.
Scripted scenes take walking away too: in the first mission's boat the
world was drawn at 1,500-5,800 draws a frame for two minutes "in a menu"
(run play-1201-1830). Tab or mouse 4 still opened the weapon wheel there
(its action is active), but the wheel's hold was not noted in a menu, and
the mouse stepped as through a menu: nothing could be picked (the
binoculars the mission asks for).

Now the context comes from one function, keyboard_events::context: a held
wheel key means play and an open wheel, wherever walking is; a menu is
walking off with no wheel held. The hold is noted for a wheel-opening action
whatever the context, keys resolve as play while a wheel is open, and
leaving the "menu" for a wheel keeps the key that opened it down (releasing
it closed the wheel at once). The mouse looks at the wheel before the menu
(gameinput, mouse), so the 50 ms until the next look cannot step a menu.

keyboard_events::tests::a_wheel_held_open_is_play_even_without_walking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The context still said "menu" wherever walking was off and no wheel was
held. Through the binoculars in the first mission's boat (run
play-1201-1845) the mouse then stepped as through a menu: its d-pad steps
zoomed, and the view did not move. The keys there found INPUT_AIM,
INPUT_SKIP_CUTSCENE and INPUT_SCRIPT_PAD_* active, and none of a menu's own
actions (accept, cancel, up, down of the frontend, game and map menus),
which every menu the title showed had (INPUT_FRONTEND_ACCEPT in every run).

A menu is now walking off with one of MENU_ACTIONS active: context()
takes it, the watch looks at them every 50 ms, and the keys' own look
(in_menu_now, one pass over the action table) does the same. Elsewhere it is
play: the mouse looks around, keys stand for play actions (W and S reach
INPUT_SCRIPT_PAD_* there, which zoom the binoculars).

keyboard_events::tests: a_menu_needs_its_own_actions_and_a_wheel_held_open_is_play,
menu_actions_hash_to_the_titles_ids.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Arrow keys press the stand-in pad's d-pad in play (VICTORY_ARROWS_DPAD=0:
  their native-keys actions, as before). The title's scripts poll the d-pad
  of the pad's reading: through the first mission's binoculars the mouse's
  menu steps (d-pad presses there) zoomed, the arrow keys sent as actions
  did not.
- VICTORY_ONE_PAD is on by default, as its comment always said: a pad the
  host finds mid-run (read over HID too since 48e7767) took the stand-in
  away, and the title showed its controller-disconnected screen.
- Keys still down when a menu or an overlay closes are pressed again as
  their play actions: entering it released them all, and W and D in the
  boat did nothing after the title's controller overlay went.
- Context changes log walking and the menu actions active; the key log
  keeps 2,000 lines.

gameinput::tests::arrow_keys_are_the_dpad.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The keys reach the title as events of the pad's sources, and the stand-in
pad's reading stayed at rest while the keyboard's held the keys. The title
took the keyboard for the device in use: in the first mission's boat,
80-170 ms after A or D went down it turned walking off and only its cursor's
accept on (INPUT_CURSOR_ACCEPT), for as long as a key was held, and showed its
controller-disconnected screen; each key event brought the pad back for
100 ms (session play-1201-2248: 77 times in ten minutes, with the action
names now in the context lines).

keyboard_events::held_axes says what the held keys hold of the sticks and
triggers, in the reading's sides (up +y, the sources' -1), steering as its
ramp has it and walking scaled; the native stand-in takes each where it is
further from rest than the mouse's. Axes only: a value given twice is the
same value, a button pressed twice is two presses.

gameinput::tests::held_axes_join_the_stand_in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sent on their own, the relay's pad events put up the title's "controller
disconnected" screen within 50 ms, and it stayed while the key was held.
Driven from a file (VICTORY_KEYS_FILE) in the first mission's boat with W
held: D's steering ramp, whose steps after the first came from the menu
watch, did it 6 times in 6 (its last step alone too, none without the
steps); W pressed again out of the pause menu did it, and so out of that
screen, which made it come back over and over. A key's own pad event
followed by the key's event never did; the two the other way round did at
every press. The title's thread is not it: the keyboard's events come on
several of its threads, and handing the events over as it reads GameInput
changed nothing.

The ramp's steps now reach the title in the stand-in pad's reading only,
which it steers by (the boat turned as far in 1.5 s either way); releases
into a menu, presses again out of it and a vehicle's new sources wait for
the next key event and go ahead of its own. With these, 0 screens in 9
rounds of W then W+D or W+A, and in 3 pauses left with W held (before:
5 to 7 a round of three).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A menu that saw W's trigger held would act on it, and there the releases
did not bring up the controller screen. Out of a menu they still wait for the
next key. Checked in the first mission's boat: the pause menu stayed on its
first tab with W held into it, no controller screen out of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In the first mission's boat the title turned the radial actions on with no
wheel open (its prompt to open one; session play-1202-2047, 7 s before Tab
was pressed): the mouse drove the wheel's held stick there, and a slight
move turned the camera on and on until the mouse went the other way. The
flag goes off once the actions are off and no wheel key is held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 21:55:15 +00:00
github manually merged commit 4e15ef9572 into main 2026-12-02 22:49:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.