mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 20:15:56 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
4.1 KiB
Markdown
47 lines
4.1 KiB
Markdown
# Controls
|
|
|
|
Input comes from the first SDL3 gamepad, the keyboard and the mouse, merged into one Switch controller (`runtime/input_win.c`). Buttons are ORed; each stick takes the source with the larger deflection. Keys and mouse buttons count only while the game window is in the foreground. `TOTK_INPUT=none` disables both (automated runs). `TOTK_*` settings can also be set in `totk.ini` next to `totk.exe` (`input = none`, `motion = 0`, `rumble = 0`); the environment overrides the file. `TOTK_RUMBLE_STRENGTH` is the rumble strength in percent (0 to 300, default 130; 0 is the same as `rumble = 0`). `TOTK_RUMBLE_CURVE` is the exponent applied to the amplitude before the strength (0.2 to 1.5, default 0.6; lower makes weak pulses stronger, 1 is linear). `TOTK_RUMBLE_TRIGGERS=1` also drives the impulse triggers of an Xbox pad.
|
|
|
|
| Switch | Gamepad (by position) | Keyboard and mouse | Action in the world |
|
|
|---|---|---|---|
|
|
| Left stick | left stick | W A S D | move |
|
|
| Right stick | right stick | mouse; arrow keys as a second source | camera |
|
|
| Y | west | left mouse button | attack |
|
|
| ZL | left trigger (over 50%) | right mouse button, Z | shield, lock on |
|
|
| ZR | right trigger (over 50%) | F, X | bow |
|
|
| X | north | Space | jump |
|
|
| B | south | Left Shift | run, cancel |
|
|
| A | east | E | interact, pick up |
|
|
| L | left shoulder | Q | abilities |
|
|
| R | right shoulder | R | throw weapon |
|
|
| Left stick click | left stick click | Left Ctrl | crouch |
|
|
| Right stick click | right stick click | C | first-person view |
|
|
| D-pad left, up, right, down | D-pad | 1 2 3 4 | quick-select |
|
|
| Plus | Start | Tab | menu, inventory |
|
|
| Minus | Back | M | map |
|
|
|
|
Esc is free. Z and X duplicate ZL and ZR so menu pages turn with two neighbouring keys; the menu tabs (L, R) are Q and R. The mouse wheel is unbound. The bindings are one table, `input_bindings` in `runtime/input_map.c` (platform-neutral key ids; `runtime/input_win.c` translates Win32 virtual keys), so a remapping page can edit it later.
|
|
|
|
## Mouse camera
|
|
|
|
Mouse motion (raw input) becomes right-stick deflection. Each presented frame takes the counts moved since the last frame, divides by the frame time and sets the deflection to `counts per second * TOTK_MOUSE_SENS / 3000` of full, held for that frame, so the turn rate does not depend on the frame rate. This is not mouselook: the game's stick curve and dead zone still apply, so very slow movements do nothing and a fast flick saturates. The mouse deflection competes with the gamepad and arrow keys by the larger-deflection rule.
|
|
|
|
`TOTK_MOUSE_SENS` (0 to 10, default 1; higher turns faster, 0 turns the mouse camera and the cursor capture off). While the window is the foreground window the cursor is hidden and confined to the client area. It is released on focus loss, minimise, while F11 changes the window, during a size or move loop and while a text entry is open. To resize or move the window by hand, alt-tab away first or use F11. `TOTK_INPUT=none` disables the capture too.
|
|
|
|
The stick direction bits (`StickLLeft` to `StickRDown`) are derived from the sticks at 50% deflection. A gamepad plugged in later is picked up within one second; with none connected the log says `input: no gamepad`.
|
|
|
|
## Scripted input
|
|
|
|
`TOTK_INPUT_SCRIPT=<file>` replays presses by presented-frame number (`gfx_counters.frames`). It is ORed with real input and still applies under `TOTK_INPUT=none`. One event per line, `#` starts a comment:
|
|
|
|
```
|
|
<frame> <button> [hold_frames] # A B X Y L R ZL ZR PLUS MINUS LEFT UP RIGHT DOWN LCLICK RCLICK; hold defaults to 4
|
|
<frame> LSTICK|RSTICK <x> <y> [hold_frames] # -32767..32767, up is +y
|
|
```
|
|
|
|
Each event logs once (`input: script frame N: A`). `tools/input/load_save.txt` loads the first save from the title screen.
|
|
|
|
## RenderDoc capture (blocked)
|
|
|
|
`TOTK_RDOC=<frame>[,...]` (`runtime/rdoc_win.c`; `TOTK_RDOC_DIR`, `TOTK_RDOC_DLL`) loads RenderDoc before `vkCreateInstance`. RenderDoc hides `VK_EXT_external_memory_host`, which the back end requires for guest pool imports (`runtime/vk_memory.c`), so device creation fails under it. A capture needs a copy-based pool fallback first.
|