kbm: swapped mouse buttons keep the primary one on the right trigger #1166
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1175"
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?
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T12:52:25Z.
Stacked on #1172; only the top commit (
kbm: swapped mouse buttons keep the primary one on the right trigger) belongs here.Keyboard and mouse as a gamepad read the mouse buttons with
GetAsyncKeyState(VK_LBUTTON / VK_RBUTTON). Microsoft's documentation ofGetAsyncKeyStatesays it checks the physical mouse buttons, not the logical buttons they are mapped to. So with the buttons swapped in Windows (left-handed,SM_SWAPBUTTON), the primary button pulled the left trigger and the secondary one the right trigger: the reverse of every other program on that PC.mouse_button_vksnow picks the primary and secondary button fromGetSystemMetrics(SM_SWAPBUTTON). The primary one pulls the right trigger, as before for a right-handed mouse.What is in it
crates/xcl/src/hle/kbm.rs:mouse_button_vks, used byapply; testswapped_mouse_buttons_keep_the_primary_on_the_right_trigger.Tested
cargo test --workspace -- --test-threads=4on6213e47(this commit on top of #1172): 743 passed, 0 failed, 41 ignored; no SKIPPED GPU testsleft: (1, 2),right: (2, 1)for swapped buttons); with the changecargo test -p xcl --lib hle::kbmpasses, 8 passedRegression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:10:20Z.
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib kbm: 9 passed, 0 failed — the swapped-button primary/secondary handling keeps the kbm suite green.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T14:40:34Z.
Whole-suite NVIDIA run, to go with the
kbmrun above.Tested
stable-x86_64-pc-windows-msvc; debug6213e4764824475b8a7d08ab281525610fd623c0(this commit on #1172, base47efa2e):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 743 passed, 0 failed, 41 ignored, the same as yoursmain930e8b4(no conflict): 753 passed, 0 failed, 41 ignoredmouse_button_vks(true)returning(0x01, 0x02)again,swapped_mouse_buttons_keep_the_primary_on_the_right_triggerfailshle::kbmtests, 10 runs: 10 of 10 passed (8 each)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
AI use
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
upstream-sync referenced this pull request2026-11-25 02:07:14 +00:00
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T14:40:01Z.
Test report for
6213e4764824475b8a7d08ab281525610fd623c0(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 743 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head, no uncommitted changes)main:
this PR:
Peak commit is over the 125 % rule: this PR's run peaked at 21 863 MB, 133 % of
main's 16 384 MB (frames: within 80 %). I can't tell from this whether the PR causes it: this branch is based on47efa2e, 490 commits older than themaincommit (06c9f55) its run is compared with, and each side was run once. A smoke run of the base itself, or of this PR rebased onto currentmain, would separate the two.Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:42:13Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:59:40Z.
Triage (#1607) – head
6213e47Stacked on #1172; only the top commit (SM_SWAPBUTTON handling in
kbm.rs:mouse_button_vks) belongs here, the shared lines are #1172's commit. No other PR handles swapped mouse buttons.The PR conflicts with main: #1824 maps the triggers through
InputProfilebindings (MouseLeft= VK 0x01,MouseRight= 0x02), so the primary/secondary swap now has to happen whereInputKeymouse buttons are read.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.