Input: load keyboard and mouse bindings per title #1814

Merged
gefydev merged 1 commit from upstream-pr/1824 into main 2026-11-27 14:21:57 +00:00
gefydev commented 2026-11-24 21:23:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-24T21:23:54Z.


Make the keyboard and mouse mapping configurable per title. Existing configurations keep the built-in mapping, and players can override individual bindings in xcl.toml.

What is in it

  • config.rs and hle/kbm.rs load a profile over the built-in bindings, including clearing keys and changing wheel outputs.
  • hle/gameinput.rs uses the profile for navigation keys under the existing focus rule. The README documents overrides.

Tested

  • Windows 10.0.26300.10075, Ryzen 5 1600, GeForce GTX 1650 (621.24), Rust 1.100.0 MSVC. Debug workspace tests and release smoke.
  • cargo build --offline --locked --workspace passed.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture: 865 passed, 0 failed, 42 ignored. Reported skips are included in the passing count.
    • SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
    • SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
    • SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
    • SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer
  • The first workspace run failed the synthetic-title completion assertion once. It passed on the baseline in isolation and on the verified head in the full rerun.
  • git diff --check and a patch apply check against the baseline passed.

Regression run

xcl-smoke v1
commit: 6c89285b8b529bde59cd17a26b911c39912fb677
gpu: NVIDIA GeForce GTX 1650
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 891 (PresentX 891)
presents per 2 s (last 3): 26 9 15
device removals: 0
crashes: 0
peak commit: 11797 MB
xcl-smoke v1
commit: b8005022c3da75f7310d7d815bcbd58d01f29cc6
gpu: NVIDIA GeForce GTX 1650
title: xcl-title
seconds: 60
exit: 0x0
frames shown: 853 (PresentX 854)
presents per 2 s (last 3): 0 8 5
device removals: 0
crashes: 0
peak commit: 11773 MB

Not tested

  • Manual rebinding in a live title, other GPUs, other keyboard layouts, and GitHub CI.

AI use

  • Codex (GPT-6 family, exact variant unavailable) implemented the patch and tests, ran the checks above, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5480579002 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1824). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-24T21:23:54Z. --- Make the keyboard and mouse mapping configurable per title. Existing configurations keep the built-in mapping, and players can override individual bindings in `xcl.toml`. **What is in it** - `config.rs` and `hle/kbm.rs` load a profile over the built-in bindings, including clearing keys and changing wheel outputs. - `hle/gameinput.rs` uses the profile for navigation keys under the existing focus rule. The README documents overrides. **Tested** - Windows 10.0.26300.10075, Ryzen 5 1600, GeForce GTX 1650 (621.24), Rust 1.100.0 MSVC. Debug workspace tests and release smoke. - `cargo build --offline --locked --workspace` passed. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture`: 865 passed, 0 failed, 42 ignored. Reported skips are included in the passing count. - SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64 - SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64 - SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll - SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows - SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer - The first workspace run failed the synthetic-title completion assertion once. It passed on the baseline in isolation and on the verified head in the full rerun. - `git diff --check` and a patch apply check against the baseline passed. **Regression run** ``` xcl-smoke v1 commit: 6c89285b8b529bde59cd17a26b911c39912fb677 gpu: NVIDIA GeForce GTX 1650 title: xcl-title seconds: 60 exit: 0x0 frames shown: 891 (PresentX 891) presents per 2 s (last 3): 26 9 15 device removals: 0 crashes: 0 peak commit: 11797 MB ``` ``` xcl-smoke v1 commit: b8005022c3da75f7310d7d815bcbd58d01f29cc6 gpu: NVIDIA GeForce GTX 1650 title: xcl-title seconds: 60 exit: 0x0 frames shown: 853 (PresentX 854) presents per 2 s (last 3): 0 8 5 device removals: 0 crashes: 0 peak commit: 11773 MB ``` **Not tested** - Manual rebinding in a live title, other GPUs, other keyboard layouts, and GitHub CI. **AI use** - Codex (GPT-6 family, exact variant unavailable) implemented the patch and tests, ran the checks above, and drafted this description.
DavidM1911 commented 2026-11-25 01:10:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T00:39:39Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7148743616 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7148743616). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T00:39:39Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
raylitebull commented 2026-11-25 01:10:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T00:55:51Z.


Code review on b800502:

  • InputProfile in crates/xcl/src/hle/kbm.rs cleanly supports per-title [input_profile] overrides in xcl.toml (with deny_unknown_fields, skip_serializing_if = "is_default", physical scancode/VK resolution, and configurable wheel outputs), while gameinput.rs keeps navigation_buttons gated behind super::kbm::enabled().
  • Both CI checks are green and RTX 3060 Ti / GTX 1650 tests pass.

What is still needed before merge: Independent AMD-machine test verification (plus an optional check of a non-default [input_profile] override in xcl.toml) to satisfy dual-vendor coverage.

<!-- greyfinch-sync:ivall/xcl:comment:7149035428 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7149035428). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T00:55:51Z. --- Code review on `b800502`: - `InputProfile` in `crates/xcl/src/hle/kbm.rs` cleanly supports per-title `[input_profile]` overrides in `xcl.toml` (with `deny_unknown_fields`, `skip_serializing_if = "is_default"`, physical scancode/VK resolution, and configurable wheel outputs), while `gameinput.rs` keeps `navigation_buttons` gated behind `super::kbm::enabled()`. - Both CI checks are green and RTX 3060 Ti / GTX 1650 tests pass. **What is still needed before merge:** Independent **AMD-machine** test verification (plus an optional check of a non-default `[input_profile]` override in `xcl.toml`) to satisfy dual-vendor coverage.
gefydev commented 2026-11-25 02:08:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-25T01:13:54Z.


A human update on this:

As we all know, modern titles have different context that also change what the keybinds do, example: R2 on foot It would hit, @@but in a vehicle, it would accelerate (no particular game, js made that up).

The only way to correctly map a KEYBOARD key to the right action ON GAME depending of the context can only be done by adding an XCL layer inside the game's memory, to expose it's context and change the keys based on that.

This is extremely difficult, so i'm patiently investigating it. I don't know if this PR is useful given that, ¿what do you think?

<!-- greyfinch-sync:ivall/xcl:comment:7149338091 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7149338091). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-25T01:13:54Z. --- A human update on this: As we all know, modern titles have different context that also change what the keybinds do, example: R2 on foot It would hit, @@but in a vehicle, it would accelerate (no particular game, js made that up). The only way to correctly map a KEYBOARD key to the right action ON GAME depending of the context can only be done by adding an XCL layer inside the game's memory, to expose it's context and change the keys based on that. This is extremely difficult, so i'm patiently investigating it. I don't know if this PR is useful given that, ¿what do you think?
futurepro62 commented 2026-11-27 05:51:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T05:51:50Z.


Full-suite run, since this PR has no test report yet. Tested exact head b8005022 (on its base 6c89285).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 864 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: default_profile_preserves_keyboard_and_mouse_bindings, profile_inherits_defaults_and_can_replace_or_clear_bindings.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 865 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main c2ee10e4 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

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:7211010907 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7211010907). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T05:51:50Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `b8005022` (on its base `6c89285`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **864 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `default_profile_preserves_keyboard_and_mouse_bindings`, `profile_inherits_defaults_and_can_replace_or_clear_bindings`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **865 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `c2ee10e4` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
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!1814
No description provided.