fix(input): Invert mouse horizontal swaps the mouse's left and right, in native look and as the stick #1028

Merged
llun merged 2 commits from Victor/Longshot:fix/native-mouse-invert into main 2026-11-16 03:38:38 +00:00
Contributor

Type: fix · Risk: low · Tested on: Linux, RTX 3050 Ti Laptop 4 GB · Needs: none

Why

With Mouse camera on Native, a player who looks inverted could not turn the mouse's left and right around. The game's own camera inversion and the menu's Invert camera X and Y act on the right stick, and in that mode the mouse is not the stick: it turns the camera's angles itself. Only up and down could be swapped, with Invert mouse vertical. Fixes #931.

How to reproduce

Seen on: reported on Windows 11, RTX 4080 (#931). Here on Linux (Arch), RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08: read from main's source and shown by the checks below failing on main; the game itself was run on this change only, not on main.
Settings and switches: Insert → Controls → Mouse camera: Native; defaults otherwise
Steps: load a save, click in the window so the mouse is captured, turn Invert camera X on (or the game's own camera inversion), move the mouse to the right
Expected: some setting makes the camera turn the other way
Actual: the camera turns the same way whatever they say: host/mouse_native.c reads Invert mouse vertical (option 8) and nothing else

What changed

A Controls row, Invert mouse horizontal, off by default, swaps the mouse's left and right wherever Invert mouse vertical already swaps its up and down: in native look, and where the mouse is the right stick. Nothing changes for a player who leaves it off.

  • host: hos_mouse_camera in host/mouse_native.c turns the yaw the other way when invert_x() says so (option 61, or HOS_MOUSE_INVERT_X=1). mouse_stick in host/nn_hid.c does the same to the stick's x, which is the path of Mouse camera As the stick, and of Native while the game takes the stick for itself (a lock-on, the bow's aim, a menu).
  • menu: the row in gpu/vk/vk_menu.cpp (opts.mouse_invert_x, vk_menu.h), answered to the host as HOS_OPT_MOUSE_INVERT_X (61) by the option callback in vk_replay.cpp: no new member in vk_api.h, so no MKWVK_API_VERSION bump. It is saved as invert_mouse_horizontal in longshot_options.ini, as every row is.
  • translations: the row's name and its help in the 13 tables of gpu/vk/menu_i18n.h.
  • docs: the README's option table; HOS_MOUSE_INVERT_X in docs/development.md's Running a test, with HOS_MOUSE_INVERT_Y, which had no line.
  • tests: tests/test_mouse_native.py (native look), tests/test_mouse_stick.py (new: mouse_stick cut out of the source and run), tests/test_mouse_settings.py (the row and its option reach both paths).

Choices a reviewer may want changed:

  1. A row of its own, not Invert camera X. Those two rows say "on the right analog stick" and turn a pad around. Read by the mouse too, they would turn the mouse around for a player who inverted only the pad.
  2. The ability wheel's pointing (L held) is swapped too, because Invert mouse vertical already swaps it there. If the wheel should point straight whatever the rows say, that is one line for each direction.
  3. No line under the row saying which way the camera then turns. On the PC it was run on, As the stick turned the camera the other way from Native with the row off (Testing), so "right turns left" would hold for one mode only. The help says what holds for both: it swaps left and right.
  4. Option 61. 59 went to the transition autosave on main while this was being written, and 60 is the item wheel's.
  5. The translations were written with the tool that assisted this change, each on its table's wording for Invert mouse vertical. I can vouch for the Spanish only.
  6. fix or feat. It fixes #931 by adding a row; the title's type is yours to change.

Overlap: #352 (WIP) reshapes host/mouse_native.c and sends every pitch through invert_y(). Its new cameras would need invert_x() for the yaw the same way; whichever lands second rebases.

Measurements

Verdict: it passes. The three checks fail on main and pass here, and in the game the row swaps the mouse's left and right with either Mouse camera. No speed to measure: two integer compares a controller read.

Hardware: Arch Linux (kernel 7.2.11), NVIDIA GeForce RTX 3050 Ti Laptop GPU 4 GB, driver 615.78.08, Intel Core i7-11800H, 31 GB RAM
Scene: Kokiri Forest (child), in a 1920x1080 window, the settings the PC's installed build had; not a speed measurement
Method: the game-free checks' output at each commit; in the game, which way the camera turns for a move of the mouse to the right, by eye, with the row off and on in each Mouse camera mode
How to reproduce: python -I -B tests/test_mouse_native.py, python -I -B tests/test_mouse_stick.py, python -I -B tests/test_mouse_settings.py; in the game, Insert → Controls, Mouse camera Native or As the stick, Invert mouse horizontal Off or On, and move the mouse to the right

Before: main @ 5f3bb44b After: this PR @ 8ade42fa
tests/test_mouse_native.py fails: FAIL line 86: near(getf(YAW), 1.0f) && near(getf(PITCH), 0.4f) (pitch 0.4 yaw -1) OK
tests/test_mouse_stick.py fails: FAIL line 144: rx < 0 && ry == 0 (stick 32767 0) PASS
tests/test_mouse_settings.py fails: the menu lost a mouse row: "Invert mouse horizontal" PASS
In the game, Mouse camera Native, the mouse moved right not run on main: no such row row off: turns right; row on: turns left
In the game, Mouse camera As the stick, the mouse moved right not run on main row off: turns left; row on: turns right

The Before column's checks are this PR's, run at its first commit (355207e5: main's sources with the new checks).

The game rows are from two runs of this change built over main @ dbad7d12, the commit the local base was built from: 15 minutes with the option still numbered 59 (both Mouse camera modes, the row off and on), and 2 minutes with it renumbered to 61 as on this head (Native, the row on: right turns left). That build's host/mouse_native.c and host/nn_hid.c are this head's, byte for byte. This head was not run in the game: main's shader translator changed since that base, and a game folder of it prepares every shader program again.

Before: main @ 5f3bb44b

After: this PR @ 8ade42fa

Both pictures are the real menu drawn by scripts/screenshots/capture_menu.py (no game, English, 1280x720), with the row above the new one selected on main and the new row selected here. That script's fixture does not link on main any more (five stand-ins are missing: xess_built, xess_why, options_path, gpu_device_cards, present_native_pq); I added them in a local copy to take these, and they are not part of this PR.

main's sources (355207e5):
FAIL line 86: near(getf(YAW), 1.0f) && near(getf(PITCH), 0.4f) (pitch 0.4 yaw -1)
FAIL line 89: near(getf(YAW), 2.0f) && near(getf(PITCH), 0.0f) (pitch 0 yaw -2)
the menu's rows: FAIL line 144: rx < 0 && ry == 0 (stick 32767 0)
FAIL line 146: rx > 0 && ry == 0 (stick -32767 0)
FAIL line 151: rx < 0 && ry > 0 (stick 23170 23170)
the menu lost a mouse row: "Invert mouse horizontal", &opts.mouse_invert_x, 0, 1,

this PR (8ade42fa):
test_mouse_native: OK
PASS: each mouse inversion turns its own direction of the stick around
PASS: the mouse's settings are the menu's

Flags and settings

A menu row, with its line in the options file, and a switch are added.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
Invert mouse horizontal (Controls; invert_mouse_horizontal in longshot_options.ini; option 61) The mouse's left and right swapped not there Off On: a move of the mouse to the right turns the camera the other way than with it off, with either Mouse camera Helps a player who looks inverted, above all with Mouse camera Native, where no other setting reaches the mouse. Run in the game on Linux with an NVIDIA card Off for everyone: a player's choice
HOS_MOUSE_INVERT_X=1 The same for one run, added to the row: on if either is not there unset As the row For scripted runs and longshot_env.txt, as HOS_MOUSE_INVERT_Y is. Covered by the two checks; not run in the game Unset

Testing

Tested:

  • The three checks, failing on main's sources and passing here; tests/test_mouse_stick.py with gcc and with clang. Each key line of the fix put back in turn (the yaw in mouse_native.c, the panning and the pointing in nn_hid.c) makes its check fail, and so does a wrong fix that reads option 8 for the horizontal.
  • python -I -B tests/run_all.py on Linux. The whole suite, with this change on main @ cefce0d1: 625 pass, 17 are skipped (Windows only, or they need the game or a Vulkan 1.3 device) and 16 fail, the same 16 that fail there without the change. After the rebases, the 190 checks that read a file this PR changes (--changed), at this head: 182 pass, 1 is skipped and 7 fail, the same 7 that fail on main @ 5f3bb44b on this PC: test_bug_report_defaults, test_crt_options, test_fsr_uniform_ownership, test_parallel_init_order, test_replay_write_order, test_vk_occlusion_queries, test_walk_key. Only test_walk_key reads a file of this PR (host/nn_hid.c); it stops on main at its own fixture (scripted_input's arguments). The rest of the 16: test_guest_imported, test_import_reach, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table, test_nonuniform_image_arrays, test_pending_guest_import, test_run_all_changed.
  • Built whole on Linux with clang at this head: scripts/dev_packs.py pack over a base of main @ dbad7d12, both modules compiled and linked.
  • Built for Windows with llvm-mingw 20261104, on Linux as the release workflow does (RX_TARGET=windows RX_VK_ONLY=1 python -I nx2/build.py --standalone): longshot_vk.dll compiles and links at this head. host/mouse_native.c and host/nn_hid.c compile for Windows with -fsyntax-only -Wall -Wextra: no error, and the warnings main @ 5f3bb44b has (1 and 63). The game's own module was not linked for Windows: that takes the whole game.
  • In the game on Linux (Arch), RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08, Kokiri Forest (child), by the person this PR is from. Mouse camera Native: with the row on, a move of the mouse to the right turns the camera left. As the stick: off turns left, on turns right. The row's line is written to the options file. The first run ended after about 15 minutes with VK_ERROR_DEVICE_LOST (NVRM Xid 62 in the kernel log); a session on the installed nightly-189, without this change, had ended in a GPU hang the day before. Not looked into here; the second run closed normally.

Not tested:

  • On Windows the game was not run.
  • In the game: this head (the runs were of the same change over main @ dbad7d12), and what the checks cover instead: the row together with Invert mouse vertical, the ability wheel's pointing, a lock-on or the bow's aim with Native, and HOS_MOUSE_INVERT_X.

Must be tested: None

Risks

What could break: the mouse's horizontal direction, with either Mouse camera, for a player who turns the row on or sets HOS_MOUSE_INVERT_X. With the row off both paths compute what they did.

Turning it off: the row's Off, its default. Reverting the commit is enough otherwise.

Compatibility: longshot_options.ini gains one line, invert_mouse_horizontal=0; a file from before has none and the row reads Off. Saves, the shader and pipeline caches and the vk ABI are untouched (a new option number answered by the existing callback; MKWVK_API_VERSION stays as it is).

Issues

Fixes #931

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** fix · **Risk:** low · **Tested on:** Linux, RTX 3050 Ti Laptop 4 GB · **Needs:** none ## Why With Mouse camera on Native, a player who looks inverted could not turn the mouse's left and right around. The game's own camera inversion and the menu's Invert camera X and Y act on the right stick, and in that mode the mouse is not the stick: it turns the camera's angles itself. Only up and down could be swapped, with Invert mouse vertical. Fixes #931. ## How to reproduce **Seen on:** reported on Windows 11, RTX 4080 (#931). Here on Linux (Arch), RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08: read from main's source and shown by the checks below failing on main; the game itself was run on this change only, not on main. **Settings and switches:** Insert → Controls → Mouse camera: Native; defaults otherwise **Steps:** load a save, click in the window so the mouse is captured, turn Invert camera X on (or the game's own camera inversion), move the mouse to the right **Expected:** some setting makes the camera turn the other way **Actual:** the camera turns the same way whatever they say: `host/mouse_native.c` reads Invert mouse vertical (option 8) and nothing else ## What changed A Controls row, Invert mouse horizontal, off by default, swaps the mouse's left and right wherever Invert mouse vertical already swaps its up and down: in native look, and where the mouse is the right stick. Nothing changes for a player who leaves it off. - host: `hos_mouse_camera` in `host/mouse_native.c` turns the yaw the other way when `invert_x()` says so (option 61, or `HOS_MOUSE_INVERT_X=1`). `mouse_stick` in `host/nn_hid.c` does the same to the stick's x, which is the path of Mouse camera As the stick, and of Native while the game takes the stick for itself (a lock-on, the bow's aim, a menu). - menu: the row in `gpu/vk/vk_menu.cpp` (`opts.mouse_invert_x`, `vk_menu.h`), answered to the host as `HOS_OPT_MOUSE_INVERT_X` (61) by the option callback in `vk_replay.cpp`: no new member in `vk_api.h`, so no `MKWVK_API_VERSION` bump. It is saved as `invert_mouse_horizontal` in `longshot_options.ini`, as every row is. - translations: the row's name and its help in the 13 tables of `gpu/vk/menu_i18n.h`. - docs: the README's option table; `HOS_MOUSE_INVERT_X` in docs/development.md's *Running a test*, with `HOS_MOUSE_INVERT_Y`, which had no line. - tests: `tests/test_mouse_native.py` (native look), `tests/test_mouse_stick.py` (new: `mouse_stick` cut out of the source and run), `tests/test_mouse_settings.py` (the row and its option reach both paths). Choices a reviewer may want changed: 1. **A row of its own, not Invert camera X.** Those two rows say "on the right analog stick" and turn a pad around. Read by the mouse too, they would turn the mouse around for a player who inverted only the pad. 2. **The ability wheel's pointing (L held) is swapped too**, because Invert mouse vertical already swaps it there. If the wheel should point straight whatever the rows say, that is one line for each direction. 3. **No line under the row saying which way the camera then turns.** On the PC it was run on, As the stick turned the camera the other way from Native with the row off (Testing), so "right turns left" would hold for one mode only. The help says what holds for both: it swaps left and right. 4. **Option 61.** 59 went to the transition autosave on main while this was being written, and 60 is the item wheel's. 5. **The translations** were written with the tool that assisted this change, each on its table's wording for Invert mouse vertical. I can vouch for the Spanish only. 6. **`fix` or `feat`.** It fixes #931 by adding a row; the title's type is yours to change. Overlap: #352 (WIP) reshapes `host/mouse_native.c` and sends every pitch through `invert_y()`. Its new cameras would need `invert_x()` for the yaw the same way; whichever lands second rebases. ## Measurements **Verdict:** it passes. The three checks fail on main and pass here, and in the game the row swaps the mouse's left and right with either Mouse camera. No speed to measure: two integer compares a controller read. Hardware: Arch Linux (kernel 7.2.11), NVIDIA GeForce RTX 3050 Ti Laptop GPU 4 GB, driver 615.78.08, Intel Core i7-11800H, 31 GB RAM Scene: Kokiri Forest (child), in a 1920x1080 window, the settings the PC's installed build had; not a speed measurement Method: the game-free checks' output at each commit; in the game, which way the camera turns for a move of the mouse to the right, by eye, with the row off and on in each Mouse camera mode How to reproduce: `python -I -B tests/test_mouse_native.py`, `python -I -B tests/test_mouse_stick.py`, `python -I -B tests/test_mouse_settings.py`; in the game, Insert → Controls, Mouse camera Native or As the stick, Invert mouse horizontal Off or On, and move the mouse to the right | | Before: main @ 5f3bb44b | After: this PR @ 8ade42fa | |---|---|---| | `tests/test_mouse_native.py` | fails: `FAIL line 86: near(getf(YAW), 1.0f) && near(getf(PITCH), 0.4f) (pitch 0.4 yaw -1)` | OK | | `tests/test_mouse_stick.py` | fails: `FAIL line 144: rx < 0 && ry == 0 (stick 32767 0)` | PASS | | `tests/test_mouse_settings.py` | fails: `the menu lost a mouse row: "Invert mouse horizontal"` | PASS | | In the game, Mouse camera Native, the mouse moved right | not run on main: no such row | row off: turns right; row on: turns left | | In the game, Mouse camera As the stick, the mouse moved right | not run on main | row off: turns left; row on: turns right | The Before column's checks are this PR's, run at its first commit (355207e5: main's sources with the new checks). The game rows are from two runs of this change built over main @ dbad7d12, the commit the local base was built from: 15 minutes with the option still numbered 59 (both Mouse camera modes, the row off and on), and 2 minutes with it renumbered to 61 as on this head (Native, the row on: right turns left). That build's `host/mouse_native.c` and `host/nn_hid.c` are this head's, byte for byte. This head was not run in the game: main's shader translator changed since that base, and a game folder of it prepares every shader program again. ![Before: main @ 5f3bb44b](https://git.magicbean.dev/attachments/2b2da75d-c238-45dd-ad40-15c112f5ffa3) ![After: this PR @ 8ade42fa](https://git.magicbean.dev/attachments/8f2ae567-2fbc-445c-b721-b02ca9973f4c) Both pictures are the real menu drawn by `scripts/screenshots/capture_menu.py` (no game, English, 1280x720), with the row above the new one selected on main and the new row selected here. That script's fixture does not link on main any more (five stand-ins are missing: `xess_built`, `xess_why`, `options_path`, `gpu_device_cards`, `present_native_pq`); I added them in a local copy to take these, and they are not part of this PR. ``` main's sources (355207e5): FAIL line 86: near(getf(YAW), 1.0f) && near(getf(PITCH), 0.4f) (pitch 0.4 yaw -1) FAIL line 89: near(getf(YAW), 2.0f) && near(getf(PITCH), 0.0f) (pitch 0 yaw -2) the menu's rows: FAIL line 144: rx < 0 && ry == 0 (stick 32767 0) FAIL line 146: rx > 0 && ry == 0 (stick -32767 0) FAIL line 151: rx < 0 && ry > 0 (stick 23170 23170) the menu lost a mouse row: "Invert mouse horizontal", &opts.mouse_invert_x, 0, 1, this PR (8ade42fa): test_mouse_native: OK PASS: each mouse inversion turns its own direction of the stick around PASS: the mouse's settings are the menu's ``` ### Flags and settings A menu row, with its line in the options file, and a switch are added. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | Invert mouse horizontal (Controls; `invert_mouse_horizontal` in `longshot_options.ini`; option 61) | The mouse's left and right swapped | not there | Off | On: a move of the mouse to the right turns the camera the other way than with it off, with either Mouse camera | Helps a player who looks inverted, above all with Mouse camera Native, where no other setting reaches the mouse. Run in the game on Linux with an NVIDIA card | Off for everyone: a player's choice | | `HOS_MOUSE_INVERT_X=1` | The same for one run, added to the row: on if either is | not there | unset | As the row | For scripted runs and `longshot_env.txt`, as `HOS_MOUSE_INVERT_Y` is. Covered by the two checks; not run in the game | Unset | ## Testing **Tested:** - The three checks, failing on main's sources and passing here; `tests/test_mouse_stick.py` with gcc and with clang. Each key line of the fix put back in turn (the yaw in `mouse_native.c`, the panning and the pointing in `nn_hid.c`) makes its check fail, and so does a wrong fix that reads option 8 for the horizontal. - `python -I -B tests/run_all.py` on Linux. The whole suite, with this change on main @ cefce0d1: 625 pass, 17 are skipped (Windows only, or they need the game or a Vulkan 1.3 device) and 16 fail, the same 16 that fail there without the change. After the rebases, the 190 checks that read a file this PR changes (`--changed`), at this head: 182 pass, 1 is skipped and 7 fail, the same 7 that fail on main @ 5f3bb44b on this PC: `test_bug_report_defaults`, `test_crt_options`, `test_fsr_uniform_ownership`, `test_parallel_init_order`, `test_replay_write_order`, `test_vk_occlusion_queries`, `test_walk_key`. Only `test_walk_key` reads a file of this PR (`host/nn_hid.c`); it stops on main at its own fixture (`scripted_input`'s arguments). The rest of the 16: `test_guest_imported`, `test_import_reach`, `test_linux_preflight`, `test_linux_update`, `test_make_game_cache`, `test_missing_nup`, `test_mods_size_table`, `test_nonuniform_image_arrays`, `test_pending_guest_import`, `test_run_all_changed`. - Built whole on Linux with clang at this head: `scripts/dev_packs.py pack` over a base of main @ dbad7d12, both modules compiled and linked. - Built for Windows with llvm-mingw 20261104, on Linux as the release workflow does (`RX_TARGET=windows RX_VK_ONLY=1 python -I nx2/build.py --standalone`): `longshot_vk.dll` compiles and links at this head. `host/mouse_native.c` and `host/nn_hid.c` compile for Windows with `-fsyntax-only -Wall -Wextra`: no error, and the warnings main @ 5f3bb44b has (1 and 63). The game's own module was not linked for Windows: that takes the whole game. - In the game on Linux (Arch), RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08, Kokiri Forest (child), by the person this PR is from. Mouse camera Native: with the row on, a move of the mouse to the right turns the camera left. As the stick: off turns left, on turns right. The row's line is written to the options file. The first run ended after about 15 minutes with `VK_ERROR_DEVICE_LOST` (NVRM Xid 62 in the kernel log); a session on the installed nightly-189, without this change, had ended in a GPU hang the day before. Not looked into here; the second run closed normally. **Not tested:** - On Windows the game was not run. - In the game: this head (the runs were of the same change over main @ dbad7d12), and what the checks cover instead: the row together with Invert mouse vertical, the ability wheel's pointing, a lock-on or the bow's aim with Native, and `HOS_MOUSE_INVERT_X`. **Must be tested:** None ## Risks **What could break:** the mouse's horizontal direction, with either Mouse camera, for a player who turns the row on or sets `HOS_MOUSE_INVERT_X`. With the row off both paths compute what they did. **Turning it off:** the row's Off, its default. Reverting the commit is enough otherwise. **Compatibility:** `longshot_options.ini` gains one line, `invert_mouse_horizontal=0`; a file from before has none and the row reads Off. Saves, the shader and pipeline caches and the vk ABI are untouched (a new option number answered by the existing callback; `MKWVK_API_VERSION` stays as it is). ## Issues Fixes #931 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
With Mouse camera on Native the mouse turns the camera's own angles, so the game's camera inversion (which turns the
right stick around) and the menu's Invert camera X never reach it, and nothing swaps its left and right (#931).
The checks fail here: a move to the right still turns right with option 61 or HOS_MOUSE_INVERT_X=1, and the menu has
no such row.

Assisted-by: Claude Code
Co-Authored-By: Claude Fable 5.2 <[email protected]>
fix(input): Invert mouse horizontal swaps the mouse's left and right, in native look and as the stick
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
8ade42faff
With Mouse camera on Native the mouse turns the camera's own angles, so the game's camera inversion, which turns the
right stick around, never reached it, and the menu's Invert camera X and Y are a pad's stick. Only up and down could be
swapped (Invert mouse vertical): there was no way to play with the horizontal look inverted (#931).

A Controls row, Invert mouse horizontal (option 61, or HOS_MOUSE_INVERT_X=1), swaps left and right wherever Invert
mouse vertical swaps up and down: the camera's yaw in host/mouse_native.c, and the mouse as the right stick in
host/nn_hid.c, which is also where Native hands the motion while the game takes the stick (a lock-on, the bow's aim, a
menu). Off by default: nothing changes for a player who does not turn it on.

Assisted-by: Claude Code
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08, Arch Linux: Kokiri Forest (child). Mouse camera Native, Invert mouse horizontal On: a move of the mouse to the right turns the camera left. Mouse camera As the stick: Off turns left, On turns right. Run on this change built over main @ dbad7d12, the last time with the option numbered 61 as on this head; this head itself was not run in the game (it builds on Linux, and its renderer for Windows).

Tested in game: RTX 3050 Ti Laptop 4 GB, NVIDIA 615.78.08, Arch Linux: Kokiri Forest (child). Mouse camera Native, Invert mouse horizontal On: a move of the mouse to the right turns the camera left. Mouse camera As the stick: Off turns left, On turns right. Run on this change built over main @ dbad7d12, the last time with the option numbered 61 as on this head; this head itself was not run in the game (it builds on Linux, and its renderer for Windows).
Author
Contributor

The two pictures of the Controls tab are in the description now: before on main @ 5f3bb44b, after on this PR @ 8ade42fa. Nothing else changed.

The two pictures of the Controls tab are in the description now: before on main @ 5f3bb44b, after on this PR @ 8ade42fa. Nothing else changed.
Victor changed title from WIP: fix(input): Invert mouse horizontal swaps the mouse's left and right, in native look and as the stick to fix(input): Invert mouse horizontal swaps the mouse's left and right, in native look and as the stick 2026-11-16 03:25:25 +00:00
llun approved these changes 2026-11-16 03:38:32 +00:00
llun merged commit e4d035e9e7 into main 2026-11-16 03:38:38 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1028
No description provided.