Skip to content

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

Closed
simnJS wants to merge 1 commit into
xcl-dev:mainfrom
simnJS:kbm-page-keys
Closed

simnJS wants to merge 1 commit into
xcl-dev:mainfrom
simnJS:kbm-page-keys

Conversation

@simnJS

@simnJS simnJS commented Nov 24, 2026 •

Copy link
Copy Markdown

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 <153482135+theaustinayers@users.noreply.github.com>
@futurepro62

Copy link
Copy Markdown

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

Tested

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

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

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 (Tests: a panicking title-texture test no longer poisons the others #673 addresses the cascade, Tests: check cubemap tile reuse independently of idle page reclamation #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

mikebuckets171 commented Nov 24, 2026 •

Copy link
Copy Markdown

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

AI use

  • GPT-6 Luna, for this verification run and comment. The commands above were run on the hardware named.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants