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

Closed
simnJS wants to merge 1 commit from upstream-pr/606 into main
simnJS commented 2026-11-24 02:24:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by simnJS on 2026-11-24T02:24:31Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:6573197619 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/606). Originally posted by [simnJS](https://github.com/simnJS) on 2026-11-24T02:24:31Z. --- 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.
futurepro62 commented 2026-11-24 07:06:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T03:59:16Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7121602387 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/606#issuecomment-7121602387). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T03:59:16Z. --- 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.
MesshM commented 2026-11-24 07:06:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:00:06Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7121614623 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/606#issuecomment-7121614623). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T04:00:06Z. --- 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.
mikebuckets171 commented 2026-11-24 08:03:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mikebuckets171 on 2026-11-24T07:55:59Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7125533339 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/606#issuecomment-7125533339). Originally posted by [mikebuckets171](https://github.com/mikebuckets171) on 2026-11-24T07:55:59Z. --- 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.
upstream-sync closed this pull request 2026-11-24 19:04:44 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!601
No description provided.