WIP: fix(input): the gyro is at rest while the Insert menu is open #1171
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1171
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:fix/gyro-rest-in-menu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Linux, RTX 4070 Ti (game-free checks) · Needs: a controller with motion
Why
With motion controls on, moving the controller while the Insert menu is open still aimed in the game, though the menu holds back the controller's buttons and sticks.
Restored from Hookshot 2962, by jarynclouatre, and split out of #286 so it can be reviewed and merged on its own.
How to reproduce
Seen on: any OS, a controller with a gyro
Settings and switches: motion controls on
Steps: aim with the slingshot, open the Insert menu, move the controller, close the menu
Expected: the aim is where it was
Actual: the aim moved
What changed
motion_countsinhost/nn_hid.calso takes the menu's state, so with the menu open the motion handler gives its at-rest state.Commits, each with its original author and message:
6308e671fix(input): the gyro is at rest while the Insert menu is open (jarynclouatre)With motion controls on, opening the Insert menu holds back a pad's
buttons and sticks (
read_input), butGetSixAxisSensorStatesonlyasked about the window and the "Controller in background" row. Moving
the controller while in the menu still aimed in the game.
Change
motion_countsinhost/nn_hid.ctakes the menu's state (rx_option(1, 0)) as well, and the motion counts only while the menu is closed. Withthe menu open the handler gives its existing at-rest state; the switch
between live and at rest already renumbers the samples.
Testing
tests/test_motion_background.py: three new cases (menu open infront; open behind another window with "Controller in background" on;
open with
HOS_INPUT_BACKGROUND=1) give the pad at rest; the six casesfrom before are unchanged. On main the handler never looks at the menu
(
motion_countshas no parameter for it).(
test_bake_portability:zstandard;nx2/test_texture_init_barrier.py:clang++); both fail the same onmain.
Restored-from: https://github.com/NotRexed/Hookshot/pull/2962
Measurements
Verdict: nothing to measure: a correctness fix off the frame path, covered by game-free checks.
Flags and settings
None.
Testing
Tested: On Linux (kernel 7.0), RTX 4070 Ti,
main@71b1edd8, this PR @6308e671:tests/test_motion_background.pypass. The full suite (tests/run_all.py) has not been run on this branch yet; a comment will follow when it has.Not tested: Moving a controller in the game. Opened as work in progress until it runs in the game.
Must be tested:
Risks
What could break: motion controls around the Insert menu.
Turning it off: revert the commit.
Compatibility: Nothing changes.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.third_party/untouched (a new folder with aPROVENANCE.mdinstead).python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).When it applies
mainand passing here.Tested in game: Linux (Ubuntu 26.04.1, kernel 7.0.0-43), RTX 4070 Ti 12 GB, NVIDIA 595.99.02, Ryzen 7 9800X3D: this branch built together with the other 18 split from #218 and #284-#288, merged onto main @
71b1edd8(make_game.py --update, build v3.0.0-rc.5-82-g5952bb3d), then played by a scripted tour through the control bridge (scripts/memtour.py: a save loaded, Zora's Domain, the Market, Hyrule Field and Death Mountain Trail, 40 s each with walking and camera swings). All 4 stops reached, a clean quit, and no device loss or Vulkan error in the log. No gyro controller was connected; the Insert menu with a moving gyro was not tried by hand.Possibly related, for context:
Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.