From 9e5a817916d86c1f97667b808766b93a260a075f Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Wed, 4 Nov 2026 08:52:06 +0300 Subject: [PATCH] Read the mouse mode with its default so direct is on without a totk.ini line direct_mode read TOTK_MOUSE_MODE with cfg_get, which is NULL when the player never set it, so a fresh totk.ini kept stick emulation (and its speed cap) while the menu showed Direct. cfg_value gives the settings table's default. Co-Authored-By: Claude Opus 5.5 --- runtime/mouse_direct.c | 4 ++-- tests/mouse_direct_check.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/mouse_direct.c b/runtime/mouse_direct.c index ecafaf06..979fa24b 100644 --- a/runtime/mouse_direct.c +++ b/runtime/mouse_direct.c @@ -23,8 +23,8 @@ #endif static int direct_mode(void) { - const char *mode = cfg_get("TOTK_MOUSE_MODE"); - return mode && !strcmp(mode, "direct") && rt_patch_enabled(rt_patch_set("mouse_direct")); + // cfg_value: unset is the settings table's default (direct), as the menu shows it + return !strcmp(cfg_value("TOTK_MOUSE_MODE"), "direct") && rt_patch_enabled(rt_patch_set("mouse_direct")); } static uint64_t last_update; diff --git a/tests/mouse_direct_check.py b/tests/mouse_direct_check.py index 212cd4f7..0dadee48 100644 --- a/tests/mouse_direct_check.py +++ b/tests/mouse_direct_check.py @@ -18,6 +18,7 @@ static float ratio=0.5f; static uint64_t now=1000000000; static GuestFn hook, activity_hook, begin_hook, angles_hook, hand_hook; const char *cfg_get(const char *key) { (void)key; return mode ? "direct" : "stick"; } +const char *cfg_value(const char *key) { return cfg_get(key); } double cfg_double(const char *key) { (void)key; return 1; } int rt_patch_set(const char *s) { (void)s; return 0; } int rt_patch_enabled(int s) { (void)s; return patched; }