diff options
| author | NotRexed <therealnothingfn@gmail.com> | 2026-11-26 23:53:24 -0500 |
|---|---|---|
| committer | NotRexed <therealnothingfn@gmail.com> | 2026-11-26 23:59:47 -0500 |
| commit | 87aa3e031dc032c4f66edf858b1b18ca96f4d406 (patch) | |
| tree | 236e5552ee01ff30af382de63272455c3ac089ce /docs | |
| parent | fa97822a78e742d221594784851b5aeec0ee1a5f (diff) | |
leonida-hle: the mouse buttons are the stand-in pad's triggers (right = LT aim, left = RT fire)
The keyboard-and-mouse stand-in pad had its triggers on Z and V only. Now the right mouse button pulls the left
trigger and the left button the right trigger, fully while held, in addition to Z and V. They count only while a window
of the runtime has focus (as the keys do), are not read while the F4 trainer menu is open, and the F1 menu already
returns no keys. The buttons travel as pseudo keys (virtual keys 1 and 2) into the pad and are removed before the
keyboard device reports its keys, so the title never sees them as keyboard input.
Checked: cargo test -p leonida-hle --features diagnostics --lib gameinput (12 passed, including the new
mouse_buttons_pull_the_triggers_and_stay_off_the_keyboard), cargo check --profile diag -p leonida --features
diagnostics. Not run in the game. docs/gameinput.md gains the D3D12 runtime's control table. AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/gameinput.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/gameinput.md b/docs/gameinput.md index 27366eb52..b2ddd3b09 100644 --- a/docs/gameinput.md +++ b/docs/gameinput.md | |||
| @@ -143,6 +143,27 @@ stick does not jump). `LEONIDA_KEYBOARD_PAD=always` reads them whatever has focu | |||
| 143 | 143 | ||
| 144 | To try it by hand: `set LEONIDA_KEYBOARD_PAD=always`, then `gameinput_probe --seconds 20` and press keys. | 144 | To try it by hand: `set LEONIDA_KEYBOARD_PAD=always`, then `gameinput_probe --seconds 20` and press keys. |
| 145 | 145 | ||
| 146 | ## The keyboard-and-mouse pad of the D3D12 runtime | ||
| 147 | |||
| 148 | The D3D12 runtime (`d3d12/`) has its own GameInput module (`d3d12/crates/leonida-hle/src/modules/gameinput.rs`) | ||
| 149 | with a stand-in pad made from the keyboard and mouse, present while no host pad is connected (or beside one, with | ||
| 150 | `LEONIDA_ONE_PAD`, the default). Keys and mouse buttons count only while a window of the runtime has focus. | ||
| 151 | |||
| 152 | | input | pad | | ||
| 153 | |---|---| | ||
| 154 | | W A S D / I J K L | left / right stick | | ||
| 155 | | arrows | d-pad | | ||
| 156 | | Space or Enter, F or Y, R or Backspace, X | A, Y, B, X | | ||
| 157 | | Q / E | shoulders | | ||
| 158 | | Left Shift or Left Ctrl / C or H | left / right stick click | | ||
| 159 | | Z or right mouse button | left trigger (LT, aim) | | ||
| 160 | | V or left mouse button | right trigger (RT, fire) | | ||
| 161 | | Esc, Tab | Menu, View | | ||
| 162 | |||
| 163 | The mouse buttons pull the triggers fully while held. They are not passed to the title while the F1 settings menu or | ||
| 164 | the F4 trainer menu is open, and they never reach the title as keyboard keys. Mouse movement still turns the camera | ||
| 165 | (the title reads the mouse itself). | ||
| 166 | |||
| 146 | ## Rumble and triggers | 167 | ## Rumble and triggers |
| 147 | 168 | ||
| 148 | `IGameInputDevice::SetRumbleState` takes four motor levels, 0..1. The two body motors go to `SDL_RumbleGamepad` on | 169 | `IGameInputDevice::SetRumbleState` takes four motor levels, 0..1. The two body motors go to `SDL_RumbleGamepad` on |