kbm: Page Up / Page Down hold the right stick up / down #606

Closed
github-bot wants to merge 1 commit from gh-pr/606/head into gh-pr/606/base
Owner

@⁠simnJS on GitHub · 2026-11-24 02:24 UTC · original
kbm-page-keys → main · +26 −1 · 2 files · 1 commits · closed without merging

With keyboard and mouse the right stick is the mouse, which deflects it only while it keeps moving, so a long menu text that scrolls with the right stick (retail title's terms of service) could not be read to the end without a gamepad. Page Up / Page Down now hold the right stick fully up / down; a real stick deflected further still wins, as for WASD and the mouse.

Ported from theaustinayers' modified build (theaustinayers/xcl, v0.1.0-mod.10), where it has been in use; credited with Co-authored-by in the commit.

What is in it

  • kbm: Page Up / Page Down hold the right stick up / down (+26 / -1): crates/xcl/src/hle/kbm.rs (stick_from_page_keys, used in apply; the mapping table of the module doc; test page_keys_hold_the_right_stick_up_or_down), README.md (Controls).

Tested

  • NVIDIA GeForce RTX 4080 SUPER (driver 621.01), AMD Ryzen 9 7950X3D, 63 GB; Windows 11 Pro build 26300; Rust 1.99.1 (stable-x86_64-pc-windows-msvc); DXC 1.8.2502.11.
  • scripts/test.ps1 (debug) on 62d31c5: 685 passed, 0 failed, 41 ignored.
  • SKIPPED on this adapter (no wave64): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.

Regression run

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 4080 SUPER
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14799 MB
xcl-smoke v1
commit: 62d31c58a5c4cfa3ceb002f4395e74d4ed859cd4
gpu: NVIDIA GeForce RTX 4080 SUPER
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1567 (PresentX 1567)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14785 MB

Same title for 60 s, XCL_NETWORK=0, no input (the keys are not pressed in these runs).

Not tested

  • The keys by hand in a title's scrolling text (the mapping is unit-tested; the fork's author uses it in the retail title's terms of service).
  • AMD and Intel GPUs, Windows 10 (no GPU code changed).

AI use

  • Claude Code with Claude Opus 5.5: ported the change from the fork, wrote the test, ran the test suite and the regression runs, and wrote this description.
**@⁠simnJS** on GitHub · 2026-11-24 02:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/606) `kbm-page-keys` → `main` · +26 −1 · 2 files · 1 commits · closed without merging With keyboard and mouse the right stick is the mouse, which deflects it only while it keeps moving, so a long menu text that scrolls with the right stick (retail title's terms of service) could not be read to the end without a gamepad. Page Up / Page Down now hold the right stick fully up / down; a real stick deflected further still wins, as for WASD and the mouse. Ported from theaustinayers' modified build (theaustinayers/xcl, `v0.1.0-mod.10`), where it has been in use; credited with `Co-authored-by` in the commit. **What is in it** - `kbm: Page Up / Page Down hold the right stick up / down` (+26 / -1): `crates/xcl/src/hle/kbm.rs` (`stick_from_page_keys`, used in `apply`; the mapping table of the module doc; test `page_keys_hold_the_right_stick_up_or_down`), `README.md` (Controls). **Tested** - NVIDIA GeForce RTX 4080 SUPER (driver 621.01), AMD Ryzen 9 7950X3D, 63 GB; Windows 11 Pro build 26300; Rust 1.99.1 (stable-x86_64-pc-windows-msvc); DXC 1.8.2502.11. - `scripts/test.ps1` (debug) on 62d31c5: 685 passed, 0 failed, 41 ignored. - SKIPPED on this adapter (no wave64): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`. **Regression run** ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: NVIDIA GeForce RTX 4080 SUPER title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1568 (PresentX 1568) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14799 MB ``` ``` xcl-smoke v1 commit: 62d31c58a5c4cfa3ceb002f4395e74d4ed859cd4 gpu: NVIDIA GeForce RTX 4080 SUPER title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1567 (PresentX 1567) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14785 MB ``` Same title for 60 s, `XCL_NETWORK=0`, no input (the keys are not pressed in these runs). **Not tested** - The keys by hand in a title's scrolling text (the mapping is unit-tested; the fork's author uses it in the retail title's terms of service). - AMD and Intel GPUs, Windows 10 (no GPU code changed). **AI use** - Claude Code with Claude Opus 5.5: ported the change from the fork, wrote the test, ran the test suite and the regression runs, and wrote this description.
A title's long menu text (GTA VI's terms of service) scrolls with the
right stick. With keyboard and mouse the right stick is the mouse, which
deflects it only while it keeps moving, so the text could not be read
to the end without a gamepad. Page Up / Page Down now hold the right
stick fully up / down (a real stick deflected further still wins, as for
WASD and the mouse).

From theaustinayers' modified build (theaustinayers/xcl, v0.1.0-mod.10),
where it has been in use; ported onto main with a test of the mapping.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-authored-by: theaustinayers <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:00 +00:00
github-bot closed this pull request 2026-11-26 04:27:00 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 03:59 UTC · original

Tested exact head 62d31c5 (on its base 9ce2070).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 642 passed, 3 failed, 21 ignored in the lib tests. The first run failed 3 lib tests that this PR does not touch: title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels (assertion left == right failed: cubemap extra_pages must be reused at same va, left 2359296, right 2555904), and then title_textures::tests::transitions_apply_when_their_list_is_submitted and vram::tests::d32s8_targets_take_their_own_size_of_video_memory on the lock it poisoned (PoisonError). The same three failed the same way in that batch on #608 and #604 (also on 9ce2070), but not in 15 later lib runs (5 each on main 9ce2070, #606 and #608). So I read it as an intermittent failure of the title-texture test on main, not this PR.
  • XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- --test-threads=4, 5 more runs: 3 passed (645 passed, 0 failed, 21 ignored), 2 hung on the #344 deadlock (gpu_uma_import_check_at_init and three other GPU tests; main has it too, #443 fixes it).

Not tested

  • The keys themselves (no interactive run), a retail title or scripts/smoke.ps1 (no title on this machine), the whole workspace suite to the end on this head, AMD, a release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 03:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/606#issuecomment-7121602387) Tested exact head `62d31c5` (on its base `9ce2070`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: 642 passed, 3 failed, 21 ignored in the lib tests. The first run failed 3 lib tests that this PR does not touch: `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels` (`assertion left == right failed: cubemap extra_pages must be reused at same va`, left 2359296, right 2555904), and then `title_textures::tests::transitions_apply_when_their_list_is_submitted` and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` on the lock it poisoned (`PoisonError`). The same three failed the same way in that batch on #608 and #604 (also on `9ce2070`), but not in 15 later lib runs (5 each on `main` `9ce2070`, #606 and #608). So I read it as an intermittent failure of the title-texture test on `main`, not this PR. - `XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- --test-threads=4`, 5 more runs: 3 passed (645 passed, 0 failed, 21 ignored), 2 hung on the #344 deadlock (`gpu_uma_import_check_at_init` and three other GPU tests; `main` has it too, #443 fixes it). **Not tested** - The keys themselves (no interactive run), a retail title or `scripts/smoke.ps1` (no title on this machine), the whole workspace suite to the end on this head, AMD, a release build. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 04:00 UTC · original

Test run of 62d31c58a5c4cfa3ceb002f4395e74d4ed859cd4 on AMD RDNA4. I merged it onto current main f4ce27c locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 658 passed, 3 failed, 21 ignored, exit code 101; 0 SKIPPED
  • the 3 failures: placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory. These three also fail on main f4ce27c with no PR applied (cargo test -p xcl --lib -- --test-threads=4: 657 passed, 3 failed), so they are not from this change. The first is placed_title_textures_share_vram_and_preserve_pixels at cubemap extra_pages must be reused at same va; the other two are PoisonErrors from the lock it poisons (#673 addresses the cascade, #447 the cubemap check). It is intermittent: alone it passes 3 of 3, and in the parallel lib run it failed on 6 of 7 runs at f4ce27c, 2 of 6 at d852f9a and 1 of 3 at 1387b4b on this machine.
  • page_keys_hold_the_right_stick_up_or_down passes.

Review: Page Up / Page Down hold the right stick fully up / down, both together do nothing, and a real stick deflected further still wins. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 04:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/606#issuecomment-7121614623) Test run of `62d31c58a5c4cfa3ceb002f4395e74d4ed859cd4` on AMD RDNA4. I merged it onto current `main` `f4ce27c` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **658 passed, 3 failed, 21 ignored**, exit code 101; 0 `SKIPPED` - the 3 failures: `placed_title_textures_share_vram_and_preserve_pixels`, `transitions_apply_when_their_list_is_submitted`, `d32s8_targets_take_their_own_size_of_video_memory`. These three also fail on `main` `f4ce27c` with no PR applied (`cargo test -p xcl --lib -- --test-threads=4`: 657 passed, 3 failed), so they are not from this change. The first is `placed_title_textures_share_vram_and_preserve_pixels` at `cubemap extra_pages must be reused at same va`; the other two are `PoisonError`s from the lock it poisons (#673 addresses the cascade, #447 the cubemap check). It is intermittent: alone it passes 3 of 3, and in the parallel lib run it failed on 6 of 7 runs at `f4ce27c`, 2 of 6 at `d852f9a` and 1 of 3 at `1387b4b` on this machine. - `page_keys_hold_the_right_stick_up_or_down` passes. **Review:** Page Up / Page Down hold the right stick fully up / down, both together do nothing, and a real stick deflected further still wins. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 07:55 UTC · original · edited 2026-11-24 08:02 UTC

Mac/Wine verification of this head as filed — and one host datapoint about the condition this route needs.

Tested

  • Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26 bottle, D3DMetal; cross target
    x86_64-pc-windows-gnullvm, LLVM-MinGW 20261117 as the linker.
  • Head 62d31c5 on base 9ce2070 (detached at the PR head, not the merged state): cargo build --workspace --locked and cargo test --no-run --release --locked green — 15 test executables, no new warnings from
    these files.
  • The tests, run under Wine in the lib unit binary: filter kbm → 8 passed, 0 failed, 0 ignored, which
    is the whole module including this PR's new page_keys_hold_the_right_stick_up_or_down and the existing
    mouse_speed_becomes_a_deflection, velocity_follows_the_counts_and_settles,
    focus_loss_resets_mouse_velocity_and_wheel_state; filter stick → 2 passed, 0 failed
    (movement_keys_make_a_unit_stick, page_keys_hold_the_right_stick_up_or_down).
    hle::gameinput::tests::keyboard_mouse_config_gates_keyboard_and_kbm_but_keeps_scripted also passes, so
    the config gate around kbm is unchanged by this patch on the Wine target.

What this host adds: keyboard routes need the window, sticks do not

On a headless or background run the keyboard path is the fragile part: keyboard() returns nothing unless
GetForegroundWindow() belongs to this process, and in this bench's Wine runs (the port's XCL_BACKGROUND=1
mode) the log says plainly keys are down (0x…) but the window has not been clicked – ignored. That is not
this PR's doing — it is the existing gate — but it means Page Up/Page Down reach the right stick only while
someone has clicked the XCL window. If #606 is meant to make a title navigable in an unattended run, the
focus gate, not the mapping, is what stops it.

For that case I have just filed #893: XCL_STICK_AT=s:x/y,… / XCL_LOOK_AT=s:x/y,… hold a deflection
from a second until the next entry, no window and no person needed. It runs after kbm in poll(), so if both
land the order is kbm (your Page-Key holds included) → scripted buttons → scripted sticks: while a scripted
entry holds it overrides them, the way a scripted button press already overrides a key. If you would rather
have a person at the window win while they are deflecting something, that is a one-line change of order and I
will make it — say so on #893. If #606 lands first I will rebase onto it.

Not tested

  • Native Windows run, and the whole suite on a GPU (CONTRIBUTING item 2).
  • Page Up/Page Down driving a real title's camera here: on this host the port presents a still picture that
    no input I can feed it changes (see #258, my picture-statistics runs), so I can verify the mapping and its
    tests but not the on-screen effect.

AI use

  • GPT-6 Luna, for this verification run and comment. The commands above were run on the hardware named.
**@⁠mikebuckets171** on GitHub · 2026-11-24 07:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/606#issuecomment-7125533339) · edited 2026-11-24 08:02 UTC Mac/Wine verification of this head as filed — and one host datapoint about the condition this route needs. **Tested** - Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26 bottle, D3DMetal; cross target `x86_64-pc-windows-gnullvm`, LLVM-MinGW 20261117 as the linker. - Head `62d31c5` on base `9ce2070` (detached at the PR head, not the merged state): `cargo build --workspace --locked` and `cargo test --no-run --release --locked` green — 15 test executables, no new warnings from these files. - The tests, run under Wine in the lib unit binary: filter `kbm` → **8 passed, 0 failed, 0 ignored**, which is the whole module including this PR's new `page_keys_hold_the_right_stick_up_or_down` and the existing `mouse_speed_becomes_a_deflection`, `velocity_follows_the_counts_and_settles`, `focus_loss_resets_mouse_velocity_and_wheel_state`; filter `stick` → **2 passed, 0 failed** (`movement_keys_make_a_unit_stick`, `page_keys_hold_the_right_stick_up_or_down`). `hle::gameinput::tests::keyboard_mouse_config_gates_keyboard_and_kbm_but_keeps_scripted` also passes, so the config gate around `kbm` is unchanged by this patch on the Wine target. **What this host adds: keyboard routes need the window, sticks do not** On a headless or background run the keyboard path is the fragile part: `keyboard()` returns nothing unless `GetForegroundWindow()` belongs to this process, and in this bench's Wine runs (the port's `XCL_BACKGROUND=1` mode) the log says plainly `keys are down (0x…) but the window has not been clicked – ignored`. That is not this PR's doing — it is the existing gate — but it means Page Up/Page Down reach the right stick only while someone has clicked the XCL window. If #606 is meant to make a title navigable in an unattended run, the focus gate, not the mapping, is what stops it. For that case I have just filed **#893**: `XCL_STICK_AT=s:x/y,…` / `XCL_LOOK_AT=s:x/y,…` hold a deflection from a second until the next entry, no window and no person needed. It runs after `kbm` in `poll()`, so if both land the order is `kbm` (your Page-Key holds included) → scripted buttons → scripted sticks: while a scripted entry holds it overrides them, the way a scripted button press already overrides a key. If you would rather have a person at the window win while they are deflecting something, that is a one-line change of order and I will make it — say so on #893. If #606 lands first I will rebase onto it. **Not tested** - Native Windows run, and the whole suite on a GPU (CONTRIBUTING item 2). - Page Up/Page Down driving a real title's camera here: on this host the port presents a still picture that no input I can feed it changes (see #258, my picture-statistics runs), so I can verify the mapping and its tests but not the on-screen effect. **AI use** - GPT-6 Luna, for this verification run and comment. The commands above were run on the hardware named.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.