Input: load keyboard and mouse bindings per title #1824

Open
github-bot wants to merge 1 commit from github-bot/gh-1824 into main AGit
Owner

@⁠gefydev on GitHub · 2026-11-24 21:23 UTC · original
gefydev:input-profiles → main · +361 −37 · 4 files · 1 commits · draft

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.
**@⁠gefydev** on GitHub · 2026-11-24 21:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/1824) `gefydev:input-profiles` → `main` · +361 −37 · 4 files · 1 commits · draft 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.
Move the default bindings into an editable profile while preserving the controller path and input focus rules. Allow overrides and unbinding in the title configuration.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:27 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 00:39 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7148743616) 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!
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:55 UTC · original

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.

**@⁠raylitebull** on GitHub · 2026-11-25 00:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7149035428) 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.
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 01:13 UTC · original

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?

**@⁠gefydev** on GitHub · 2026-11-25 01:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1824#issuecomment-7149338091) 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?
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1824/head:github-bot/gh-1824'
git switch 'github-bot/gh-1824'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1824'
git switch 'github-bot/gh-1824'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1824'
git switch 'github-bot/gh-1824'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1824'
git switch 'main'
git merge --squash 'github-bot/gh-1824'
git switch 'main'
git merge --ff-only 'github-bot/gh-1824'
git switch 'main'
git merge 'github-bot/gh-1824'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.