Change freecam default binds for keyboard and controller to none, configurable through totk.ini or the Controls tab.

freecam_key and freecam_pad were F6 and ZL+ZR+L3 for everyone, potentially causing unwanted toggles. F6 is also the
quick save key of #1188. Both are none now.

runtime/cfg.c: the FREECAM_PAD and FREECAM_KEY rows of the settings table default to none. runtime/input.c
freecam_pad_mask reads the combo with cfg_value instead of falling back to its own zl+zr+lstick, so an unset combo is
the table's none like the key. The comments in runtime/freecam.c, runtime/input.c and runtime/ui/menu.cpp
rows_freecam, docs/controls.md ("Free camera") and totk.ini.example say so and keep F6 and ZL+ZR+L3 as examples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lebomisandClaude Opus 5.5 committed 2026-11-19 13:32:23 +11:00
1 parent 5fa6db3c70
commit 88f9a965af
6 files changed
+19 -17

No files matched your search

+4 -3
View File
@@ -131,9 +131,10 @@ bind_Y = pad:north, key:mouse_l
## Free camera
On game 1.4.3, ZL+ZR+L3 together (LT+RT+L3 on an Xbox pad) or F6 detach the view from Link; the same combo or key brings
it back (`freecam_pad` and `freecam_key` in `totk.ini` and on the Controls tab pick others, `none` none). The world goes
on, but the game gets no input while the free camera is on, so Link stands where he was.
On game 1.4.3, a chosen gamepad combo or a key activates or deactivates the free camera. Neither is set by default: pick
them with `freecam_pad` and `freecam_key` in `totk.ini` or on the Controls tab (for example ZL+ZR+L3, LT+RT+L3 on an
Xbox pad, and F6; `none` turns one off). The world goes on, but the game gets no input while the free camera is on, so
Link stands where he was.
| Gamepad | Keyboard and mouse (default bindings) | Free camera |
|---|---|---|
+1 -1
View File
@@ -189,7 +189,7 @@ static const CfgMeta metas[] = {
{"QUICKSAVE", "0", "0|1", LIVE}, // quicksave.c: one key saves (an autosave), another loads it
{"QUICKSAVE_KEY", "f6", NULL, LIVE}, {"QUICKLOAD_KEY", "f7", NULL, LIVE}, // Half-Life's keys; a key name or none
{"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE},
{"FREECAM_PAD", "zl+zr+lstick", NULL, LIVE}, {"FREECAM_KEY", "f6", NULL, LIVE},
{"FREECAM_PAD", "none", NULL, LIVE}, {"FREECAM_KEY", "none", NULL, LIVE},
// Gameplay Tweaks
{"GAMEPLAY_TWEAKS_ENABLED", "0", "0|1", LIVE},
{"GAMEPLAY_ULTRAHAND_ROTATE", "1", "0|1", LIVE}, {"GAMEPLAY_ULTRAHAND_C_AXIS", "1", "0|1", LIVE},
+6 -5
View File
@@ -21,11 +21,12 @@
// the anchor is driven. When no driven component has been updated for LOST_NS (a load replaced them) the next one
// away from the default anchors again; the free camera keeps its own position.
//
// Input (runtime/input.c freecam_gate): TOTK_FREECAM_PAD (ZL+ZR+L3 by default) or TOTK_FREECAM_KEY (F6) switches
// it. While it is on the game gets no input; the left stick flies along the view and to the side, ZR and ZL straight
// up and down, the right stick and the mouse turn, and each press of L or R halves or doubles the speed. Keys work
// through their bindings: the keys' sticks, and the keys bound to ZL, ZR, L and R. Every driven component steps the
// flight by the wall-clock time since the last step, so the speed is the same at any frame rate and game speed.
// Input (runtime/input.c freecam_gate): TOTK_FREECAM_PAD or TOTK_FREECAM_KEY switches it (both none by default, so the
// player opts in). While it is on the game gets no input; the left stick flies along the view and to the side, ZR and
// ZL straight up and down, the right stick and the mouse turn, and each press of L or R halves or doubles the speed.
// Keys work through their bindings: the keys' sticks, and the keys bound to ZL, ZR, L and R. Every driven component
// steps the flight by the wall-clock time since the last step, so the speed is the same at any frame rate and game
// speed.
#include <math.h>
#include <stdint.h>
#include <stdio.h>
+5 -6
View File
@@ -815,8 +815,8 @@ uint32_t input_pad_combo(const char *env, const char *s) {
return mask;
}
// TOTK_FREECAM_PAD (live): the combo that switches the free camera (freecam.c); zl+zr+lstick (LT+RT+L3) when unset,
// none for no combo. Under lock.
// TOTK_FREECAM_PAD (live): the combo that switches the free camera (freecam.c), for example zl+zr+lstick (LT+RT+L3);
// none, the default (the settings table), for no combo. Under lock.
static uint32_t freecam_pad_mask(void) {
static unsigned seen;
static int read;
@@ -824,13 +824,12 @@ static uint32_t freecam_pad_mask(void) {
unsigned v = cfg_version();
if (read && v == seen) return mask;
read = 1, seen = v;
const char *s = cfg_get("TOTK_FREECAM_PAD");
if (!s || !*s) s = "zl+zr+lstick";
mask = strcasecmp(s, "none") ? input_pad_combo("TOTK_FREECAM_PAD", s) : 0;
const char *s = cfg_value("TOTK_FREECAM_PAD");
mask = *s && strcasecmp(s, "none") ? input_pad_combo("TOTK_FREECAM_PAD", s) : 0;
return mask;
}
// TOTK_FREECAM_KEY (live): the key that switches the free camera, f6 by default (the settings table), none for no key.
// TOTK_FREECAM_KEY (live): the key that switches the free camera; none, the default (the settings table), for no key.
// Under lock.
static int freecam_key(void) {
static unsigned seen;
+1 -1
View File
@@ -962,7 +962,7 @@ static void rows_freecam(void) {
names[N - 1] = menu_text(UI_MENU_OFF);
if (!freecam_available()) opt_disable_next(UI_MENU_FREECAM_PAD_V143);
opt_choice_list("TOTK_FREECAM_PAD", UI_MENU_FREECAM_PAD, combos, names, N, UI_MENU_FREECAM_PAD_DESC);
// The free camera key: keys no default binding uses ("none" rather than an empty value turns it off: unset is f6)
// The free camera key: keys no default binding uses (none, the default, turns it off)
static const char *const keys[] = {"none", "f2", "f3", "f4", "f5", "f6", "f7", "f9"};
const char *key_names[] = {menu_text(UI_MENU_OFF), "F2", "F3", "F4", "F5", "F6", "F7", "F9"};
if (!freecam_available()) opt_disable_next(UI_MENU_FREECAM_PAD_V143);
+2 -1
View File
@@ -483,10 +483,11 @@
# Free camera (game 1.4.3): the gamepad combo that switches it, buttons by position joined with +, the pad: names of the
# bind_ lines. While it is on the game gets no input and the view flies: the left stick along the view and sideways,
# the triggers straight up and down, the right stick turns; each press of L halves the speed, of R doubles it
# (docs/controls.md, "Free camera"). none turns the combo off. Default: zl+zr+lstick (LT+RT+L3 on an Xbox pad).
# (docs/controls.md, "Free camera"). none turns the combo off. Default: none;
# freecam_pad = zl+zr+lstick
# A key that does the same, by its name in the bind_ lines; on the keyboard the keys bound to the sticks fly and turn,
# the keys of ZR and ZL go up and down, those of R and L change the speed, and the mouse turns. none turns it off.
# Default: none.
# freecam_key = f6
# Write the input of this run to a file that replays as a script (docs/controls.md, "Scripted input"). Default: off.
# input_record = input.txt