From 300f88e95f38380de34e6b7ecff90bcc246f20c2 Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:54:58 +0100 Subject: [PATCH 1/2] The mouse turns cameras that run no direct mouse hook, such as Autobuild's placement camera, as the right stick (#1300) With mouse_mode = direct the mouse reached only the cameras the direct hooks cover. Autobuild's placement camera runs none of them on games 1.4.3 and 1.2.1 and turns by the right stick, so the mouse moved nothing there. mouse_direct.c now notes each camera step that runs a hook; after two steps without one the mouse acts as the right stick (input.c mouse_camera), as with mouse_mode = stick, until a hook runs again. A script's MOUSE lines move that stick too, also under TOTK_INPUT=none, so the path can be tested with scripted input. Co-Authored-By: Claude Opus 5.5 --- docs/controls.md | 13 +++++-- runtime/input.c | 23 +++++++++++- runtime/mouse_direct.c | 30 ++++++++++++++-- tests/mouse_direct_check.py | 71 +++++++++++++++++++++---------------- 4 files changed, 101 insertions(+), 36 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index e2102f4b..9fcbe68d 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -154,6 +154,12 @@ degrees a count as the camera does elsewhere. The follow range is read from the once, the mouse is stick input there). The stick loads that only test for input keep the mouse in the stick. A step with mouse motion that no direct hook took is logged (`mouse: step N with mouse motion took the stick path`, the first 30, then one in 600, with the player's state), so the cameras still on stick input show in `logs/totk.log`. +Some cameras run none of the direct hooks and read their turn from input the hooks never see: Autobuild's placement +camera (games 1.4.3 and 1.2.1) turns by the right stick but, in direct mode, not by the mouse (issue #1300). After two +camera steps in a row that ran no direct hook (none of the free orbit, the load sites above or Ultrahand's held-object +input), the mouse acts as the right stick there, as with `mouse_mode = stick`, until a step runs a direct hook again +(`mouse: the camera runs no direct hook; the mouse acts as the right stick` and `... runs a direct hook again` in the +log, the first 6 changes; `camera_unhooked` in `runtime/mouse_direct.c`). Lock-on keeps pointing the camera at the target; the stick, and so the mouse, adds an offset around that direction, which the game limits and lets return: the mouse's degrees are the step's turn the game adds to the offset and judges the return by. @@ -291,7 +297,7 @@ own (`gyro_bias_pad` ends in "(under Steam)"). ```