From b477b489ff980124aa4e57fc0533c7d8086504c1 Mon Sep 17 00:00:00 2001 From: Louis Justice Date: Tue, 10 Nov 2026 19:54:10 -0500 Subject: [PATCH] Turn dialogue_click off by default, so each key presses one controller button unless the player opts in. Co-Authored-By: Claude Opus 5.5 --- docs/controls.md | 2 +- runtime/cfg.c | 2 +- runtime/menu_cursor.c | 6 +++--- totk.ini.example | 13 +++++++------ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index f24f83a9..676517cd 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -205,7 +205,7 @@ On game 1.4.3, while one of the game's menus has its focus box (the frame the d- ### Clicks in dialogue -On game 1.4.3, while a dialogue box is open (the layout `MessageDialog_00`: a character's lines and the game's own messages), the left mouse button presses B and the right one A, instead of the buttons they are bound to. B continues the text as A does and also shows the rest of a line that is still scrolling in; the left button's default, Y, would open the dialogue log there, and the log stays in the way until B closes it. Dialogue choices are a menu with the focus box, so the pointer above takes their clicks and a left click is A on the choice under it: clicking through a conversation fast does not pick the choice the focus starts on. A press is the dialogue's button or the binding from the moment the button goes down until it is released: the click that closes the last box does not become an attack while it is still held, and a button held when the box opens does not skip its first line. Between two lines of a conversation the game closes the box and opens it again, so both buttons stay B and A for 500 ms after the box was last open (`DIALOGUE_GAP_MS`); the first clicks after a conversation fall in that time too, as they do for a player who taps the button through the last line. `TOTK_MENU_CURSOR_LOG=1` logs how long each such gap was. The dialogue window has no focus box of its own: the scan of `eui::ScreenMgr`'s open screens (every 100 ms) finds its screen, and from then on that screen's state is read at every pad read (`dialogue_shown` in `runtime/menu_cursor.c`), so the first click after a box opens is already the dialogue's. `dialogue_click = 0` (`TOTK_DIALOGUE_CLICK=0`, live; the *Clicks in dialogue* row of the Controls tab) leaves both buttons on their bindings; the setting does not depend on `menu_cursor`. The log names the first box it sees (`menu_cursor: a dialogue box is open ...`). +With `dialogue_click = 1` (off by default, so each key presses one controller button as everywhere else), on game 1.4.3, while a dialogue box is open (the layout `MessageDialog_00`: a character's lines and the game's own messages), the left mouse button presses B and the right one A, instead of the buttons they are bound to. B continues the text as A does and also shows the rest of a line that is still scrolling in; the left button's default, Y, would open the dialogue log there, and the log stays in the way until B closes it. Dialogue choices are a menu with the focus box, so the pointer above takes their clicks and a left click is A on the choice under it: clicking through a conversation fast does not pick the choice the focus starts on. A press is the dialogue's button or the binding from the moment the button goes down until it is released: the click that closes the last box does not become an attack while it is still held, and a button held when the box opens does not skip its first line. Between two lines of a conversation the game closes the box and opens it again, so both buttons stay B and A for 500 ms after the box was last open (`DIALOGUE_GAP_MS`); the first clicks after a conversation fall in that time too, as they do for a player who taps the button through the last line. `TOTK_MENU_CURSOR_LOG=1` logs how long each such gap was. The dialogue window has no focus box of its own: the scan of `eui::ScreenMgr`'s open screens (every 100 ms) finds its screen, and from then on that screen's state is read at every pad read (`dialogue_shown` in `runtime/menu_cursor.c`), so the first click after a box opens is already the dialogue's. `dialogue_click = 1` (`TOTK_DIALOGUE_CLICK=1`, live; the *Clicks in dialogue* row of the Controls tab) turns it on and `0`, the default, leaves both buttons on their bindings; the setting does not depend on `menu_cursor`. The log names the first box it sees (`menu_cursor: a dialogue box is open ...`). ## Nintendo Switch 2 controllers diff --git a/runtime/cfg.c b/runtime/cfg.c index 31059806..58861ed4 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -156,7 +156,7 @@ static const CfgMeta metas[] = { {"LSTICK_DEADZONE", "", "0..50", LIVE}, {"RSTICK_DEADZONE", "", "0..50", LIVE}, {"MOUSE_MODE", "direct", "stick|direct", LIVE}, {"MOUSE_SENS", "1", "0..10", LIVE}, {"MOUSE_AIM_SCALE", "1", "0.1..3", LIVE}, {"MENU_CURSOR", "1", "0|1", LIVE}, - {"DIALOGUE_CLICK", "1", "0|1", LIVE}, // menu_cursor.c: in a dialogue box left click is B, right click A + {"DIALOGUE_CLICK", "0", "0|1", LIVE}, // menu_cursor.c: in a dialogue box left click is B, right click A {"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE}, {"MENU_LANG", "", "en|ru|pt-BR|zh-Hans", LIVE}, {"AMIIBO_DIR", "", NULL, LIVE}, diff --git a/runtime/menu_cursor.c b/runtime/menu_cursor.c index c0f1ba4b..2eb5c268 100644 --- a/runtime/menu_cursor.c +++ b/runtime/menu_cursor.c @@ -23,8 +23,8 @@ // // The same read of the open screens tells input.c when a dialogue box is on screen (menu_cursor_dialogue), where the // left mouse button presses B (it advances the text and skips its scroll) and the right one A, instead of their -// bindings (Y by default, which opens the dialogue log, and ZL). TOTK_DIALOGUE_CLICK (live, default 1) switches that -// on its own: it does not need the pointer. +// bindings (Y by default, which opens the dialogue log, and ZL). TOTK_DIALOGUE_CLICK (live, default 0: one key per +// controller button) switches that on its own: it does not need the pointer. #include #include #include @@ -386,7 +386,7 @@ void menu_cursor_poll(uint64_t *buttons) { int dialogue = box || (dialogue_seen && now - dialogue_seen < DIALOGUE_GAP_MS); if (dialogue && !dialogue_logged) dialogue_logged = 1, rt_log("menu_cursor: a dialogue box is open (" DIALOGUE_SCREEN "): left click is B, " - "right click A (TOTK_DIALOGUE_CLICK=0 turns it off)"); + "right click A (TOTK_DIALOGUE_CLICK=1)"); __atomic_store_n(&g_dialogue, dialogue, __ATOMIC_RELAXED); if (!cursor) { set_pointer(0); __atomic_store_n(&g_map, 0, __ATOMIC_RELAXED); return; } Focus f = focus_now(); diff --git a/totk.ini.example b/totk.ini.example index 09860f2a..13a37f7d 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -348,12 +348,13 @@ # right click is B. On the map the mouse moves the map's cursor and the scroll wheel zooms. 0 leaves the menus and # the map to the keys and the pad. Changes while the game runs. # menu_cursor = 1 -# The mouse buttons in dialogue, 1.4.3 only: while a dialogue box is open left click presses B (it continues the text -# and skips its scroll) and right click presses A, instead of their bindings (Y by default, which opens the dialogue -# log, and ZL). Dialogue choices keep the pointer, where left click picks. Works with menu_cursor = 0 too. The clicks -# stay B and A for half a second after a box closes, as the game closes the box between two lines of a conversation. -# 0 leaves both buttons on their bindings there. Changes while the game runs. -# dialogue_click = 1 +# The mouse buttons in dialogue, 1.4.3 only. 1: while a dialogue box is open left click presses B (it continues the +# text and skips its scroll) and right click presses A, instead of their bindings (Y by default, which opens the +# dialogue log, and ZL). Dialogue choices keep the pointer, where left click picks. Works with menu_cursor = 0 too. The +# clicks stay B and A for half a second after a box closes, as the game closes the box between two lines of a +# conversation. 0 (the default) leaves both buttons on their bindings there, one key per controller button. Changes +# while the game runs. +# dialogue_click = 0 # Mouse camera sensitivity (0 to 10; 0 = no mouse camera and no cursor capture). With mouse_mode = direct, 1 turns the # camera 0.08 degrees per count, the same in every camera mode (about 14.3 cm a turn at 800 DPI). # mouse_sens = 1