LARP_PROMPTS=auto: keyboard key caps for mouse & keyboard players #136

Manually merged
github merged 1 commit from github-bot/gh-136 into main 2026-12-05 21:05:24 +00:00 AGit
Owner

@⁠IndianStalker on GitHub · 2026-12-05 19:27 UTC · original
IndianStalker:prompts-auto → main · +113 −7 · 4 files · 1 commits · merged 2026-12-05 21:02 UTC

What

Until now LARP_PROMPTS=auto (the default) only chose between PlayStation symbols (a DualSense/DS4 connected) and the stock Xbox prompts. Mouse & keyboard players saw controller icons unless they edited bin\launch.ps1, and with a PlayStation pad merely paired they got PS symbols while playing on the keyboard.

auto now picks once at start:

Situation Prompts
LARP_CONTROLS=mnk keyboard key caps (the keys you actually bound, via #62)
a DualSense / DS4 is connected PlayStation symbols (as before)
LARP_CONTROLS=pad, or an XInput pad is connected stock Xbox prompts (as before)
no controller connected at all keyboard key caps

Explicit values (keys, xbox, playstation) behave exactly as before.

How

  • apps/larp/src/run.rs: the auto branch calls auto_prompt_style(), which logs its pick (prompts: LARP_PROMPTS=auto picked the button style). The decision itself is a small pure function, pick_prompt_style(mode, ps_pad, xinput_pad), with 5 unit tests.
  • crates/larp-hle/src/modules/gameinput.rs: xinput_pad_present() asks the four XInput slots once. It is only called when the earlier rules don't decide, because an empty slot can take ~67 ms to answer.
  • Docs: environment-variables.md and controls-and-input.md describe the new auto.

The style is still chosen once at start (the title loads its icon movie once), so switching live between keyboard and pad is not part of this.

Tested

  • cargo build --release --locked -p larp: builds with no new warnings.
  • cargo test -p larp prompt_style: 5 passed.
  • Not played yet with this exact build. The key-cap drawing itself is unchanged; only the choice of style is new.

🤖 Generated with Claude Code

**@⁠IndianStalker** on GitHub · 2026-12-05 19:27 UTC · [original](https://github.com/gamingwithhomie/larp/pull/136) `IndianStalker:prompts-auto` → `main` · +113 −7 · 4 files · 1 commits · merged 2026-12-05 21:02 UTC ## What Until now `LARP_PROMPTS=auto` (the default) only chose between PlayStation symbols (a DualSense/DS4 connected) and the stock Xbox prompts. Mouse & keyboard players saw controller icons unless they edited `bin\launch.ps1`, and with a PlayStation pad merely paired they got PS symbols while playing on the keyboard. `auto` now picks once at start: | Situation | Prompts | |---|---| | `LARP_CONTROLS=mnk` | keyboard key caps (the keys you actually bound, via #62) | | a DualSense / DS4 is connected | PlayStation symbols (as before) | | `LARP_CONTROLS=pad`, or an XInput pad is connected | stock Xbox prompts (as before) | | no controller connected at all | keyboard key caps | Explicit values (`keys`, `xbox`, `playstation`) behave exactly as before. ## How - `apps/larp/src/run.rs`: the `auto` branch calls `auto_prompt_style()`, which logs its pick (`prompts: LARP_PROMPTS=auto picked the button style`). The decision itself is a small pure function, `pick_prompt_style(mode, ps_pad, xinput_pad)`, with 5 unit tests. - `crates/larp-hle/src/modules/gameinput.rs`: `xinput_pad_present()` asks the four XInput slots once. It is only called when the earlier rules don't decide, because an empty slot can take ~67 ms to answer. - Docs: `environment-variables.md` and `controls-and-input.md` describe the new `auto`. The style is still chosen once at start (the title loads its icon movie once), so switching live between keyboard and pad is not part of this. ## Tested - `cargo build --release --locked -p larp`: builds with no new warnings. - `cargo test -p larp prompt_style`: 5 passed. - Not played yet with this exact build. The key-cap drawing itself is unchanged; only the choice of style is new. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Until now `auto` only chose between PlayStation symbols (a DualSense/DS4
connected) and the stock Xbox prompts, so mouse & keyboard players saw
controller icons unless they edited launch.ps1. `auto` now picks once at
start:

- LARP_CONTROLS=mnk                    -> keyboard key caps
- a DualSense/DS4 is connected         -> PlayStation symbols
- LARP_CONTROLS=pad, or an XInput pad  -> stock Xbox prompts
- no controller connected at all       -> keyboard key caps

The choice is logged ("prompts: LARP_PROMPTS=auto picked the button
style"). Explicit LARP_PROMPTS values are unchanged. The XInput check is
only asked when the earlier rules don't decide (an empty slot can take
~67 ms). The decision is a small pure function with unit tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 19:32:01 +00:00
github-bot referenced this pull request from a commit 2026-12-05 21:05:10 +00:00
github manually merged commit aa2946e727 into main 2026-12-05 21:05:24 +00:00
Author
Owner

@⁠HeyOkay on GitHub · 2026-12-06 01:58 UTC · original

This default makes no sense for mixed-input/controller users. After updating to v1.1.6, I ended up with keyboard prompts when I wanted to play with a controller.

Why make this the default auto behavior while the choice is frozen at startup? If a controller is connected or becomes available after launch, the prompts remain wrong, and users have to edit launch.ps1 or restart the game to fix them.

auto should follow the last device actually used: controller input should show the appropriate Xbox/PlayStation buttons, and keyboard/mouse input should show key caps.

I see the note that the title loads its icon movie once. Is refreshing/replacing those icons at runtime technically blocked, or was it simply outside this PR's scope? That constraint explains the implementation, but it does not make startup-only selection a good default.

Please implement dynamic switching on input-device changes. Until that is available, keyboard prompts should be opt-in, or there should at least be an obvious in-game override that does not require restarting.

**@⁠HeyOkay** on GitHub · 2026-12-06 01:58 UTC · [original](https://github.com/gamingwithhomie/larp/pull/136#issuecomment-7449588678) This default makes no sense for mixed-input/controller users. After updating to v1.1.6, I ended up with keyboard prompts when I wanted to play with a controller. Why make this the default `auto` behavior while the choice is frozen at startup? If a controller is connected or becomes available after launch, the prompts remain wrong, and users have to edit launch.ps1 or restart the game to fix them. `auto` should follow the last device actually used: controller input should show the appropriate Xbox/PlayStation buttons, and keyboard/mouse input should show key caps. I see the note that the title loads its icon movie once. Is refreshing/replacing those icons at runtime technically blocked, or was it simply outside this PR's scope? That constraint explains the implementation, but it does not make startup-only selection a good default. Please implement dynamic switching on input-device changes. Until that is available, keyboard prompts should be opt-in, or there should at least be an obvious in-game override that does not require restarting.
This discussion has been locked. Commenting is limited to contributors.
No description provided.