Skip to content

Native mouse: only the active player camera takes the mouse (slingshot aim, shops) - #1462

Merged
hckrman101 merged 2 commits into
NotRexed:mainfrom
Joey-Magnus:fix/native-mouse-aim
Nov 10, 2026
Merged

hckrman101 merged 2 commits into
NotRexed:mainfrom
Joey-Magnus:fix/native-mouse-aim

Conversation

@Joey-Magnus

Copy link
Copy Markdown
Contributor

What

With Mouse camera = Native, the slingshot's first-person aim does not turn with the mouse (forum report; it works with "as the stick", and another player reports the same in shops). host/mouse_native.c gives the mouse to the player camera whenever that camera's update hook ran in the last 150 ms. While aiming, that camera keeps updating in the background while a different camera draws. So the mouse turned a camera nobody was looking through, and the right stick that the aim reads got nothing.

I traced the camera's state at +0x204 at Hyrule Castle: 4 while the player turns it, 0 while the slingshot aims, and 3 after. The camera now takes the mouse only in states 3 (following Link) and 4 (turned by the player). In any other state the hook counts as not run, so hos_mouse_native returns -1 and the motion goes to the right stick.

Tested

  • A test build with a temporary trace confirmed the states above (Linux, RTX 4070 Ti).
  • tests/test_mouse_native.py: the fake camera now has state 4. A new case checks that state 0 leaves the camera alone and gives the motion to the stick, and that state 3 takes it again. That case fails without the change. The full tests/run_all.py passes: 189 passed, 19 skipped.
  • Not yet tested: aiming with a real mouse, since my test runs can't move one. The behaviour without native mode, and with native mode outside these states, is unchanged.

🤖 Generated with Claude Code

…t aim, shops)

With the menu's Mouse camera on Native, the slingshot's first-person aim
(and, as reported, shops) did not turn with the mouse: the player
camera's update keeps running while another camera draws, so its hook
claimed the mouse and the stick the aim reads got nothing. Traced at
Hyrule Castle: its state at +0x204 is 4 while the player turns it, 0
while the slingshot aims, 3 after. The camera now takes the mouse only
in states 3 and 4; otherwise the motion stays the right stick's.

tests/test_mouse_native.py: the fake camera has state 4; state 0 leaves
the camera and gives the motion to the stick, state 3 takes it again
(fails without the change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ra states (review)

When the camera leaves states 3/4, last_hook_ns is reset so the stick
takes the next motion instead of a burst once the 150 ms run out. Each
other state seen is logged once (up to 8), so a view that should turn
with the mouse (Z-targeting, climbing, swimming) is easy to add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joey-Magnus

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Nits addressed in the latest commit on this branch (tests pass locally).

@hckrman101
hckrman101 merged commit 57550c3 into NotRexed:main Nov 10, 2026
8 checks passed
NotRexed pushed a commit that referenced this pull request Nov 10, 2026
docs/tested-configurations.md keeps one row per test run: build (from the
log's first line), OS and desktop, GPU and driver, CPU and RAM, the
settings that matter, where in the game, and what was measured; plus
what is not covered yet. Seeded with the Linux + RTX 4070 Ti runs made
while testing #1308, #1305, #1459, #1462 and HDR. CONTRIBUTING's "Test on
other hardware" points testers at it.

Co-authored-by: Joey Magnus <joey.magnus@cxalloy.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant