Skip to content

Controllers: gyro aim and turbo for player 1 - #485

Open
insertfloppy wants to merge 2 commits into
willfaust:mainfrom
insertfloppy:upstream/gyro-aim
Open

insertfloppy wants to merge 2 commits into
willfaust:mainfrom
insertfloppy:upstream/gyro-aim

Conversation

@insertfloppy

Copy link
Copy Markdown
Contributor

Requested by Cameron · project thread

Gyro aim and turbo, per game and off by default, under Game details ›
Controls › Gyro aim & turbo and the same page in the in-game Session menu.
Two commits.

Changes

  1. Gyro aim and turbo for player 1 (new PadAssist.swift). Gyro aim adds
    the controller's rotation (DualSense, DualShock 4, Switch Pro, Joy-Con) or
    the device's own gyro to the right stick: always or while holding LT/LB/RB,
    yaw or roll to turn, sensitivity 0.25×–4×, an anti-dead zone and inversion.
    Turbo repeats chosen buttons (A/B/X/Y/LB/RB/LT/RT) 5–30 times a second while
    held, touch buttons included. It's applied in GamepadInput.sample() after
    the touch merge, so XInput, the HID controller and the stick mouse all see
    it. Settings live in LibraryEntry.padAssist.
  2. Move the mouse when the game sees no controller. A mouse game with no
    controller has no player 1, so the right stick gyro aim fed went nowhere. A
    Moves choice (Automatic, Right stick, Mouse) now moves the mouse when there
    is no controller for the game, or in keyboard-and-mouse mode. The 4 ms poll
    runs for it without a pad.

Docs: CONTROLLERS.md, "Gyro aim and turbo". [pad-assist] log lines record
each session's choices. tests/host/check-pad-assist.py covers the math
(settings decoding, gyro scaling, the anti-dead zone, turbo timing).

Testing

  • On device (iPhone, sideloaded build): gyro aim with no controller,
    using the device's gyro to move the mouse, works. Turbo and gyro from a
    physical controller weren't part of that test.
  • This branch: the two commits applied to main c2c1b03 without conflicts.
    They aren't compiled here (no Swift toolchain), so CI is the first compile on
    this base.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LiLQakAySboBR7FkqkJFKS

insertfloppy and others added 2 commits October 29, 2026 06:46
Gyro aim adds the controller's rotation (DualSense, DualShock 4, Switch Pro,
Joy-Con) or the device's own gyro to the right stick: always or while holding
LT/LB/RB, yaw or roll to turn, sensitivity, anti-dead zone and inversion.
Turbo repeats chosen buttons (A/B/X/Y/LB/RB/LT/RT) 5-30 times a second while
held, touch buttons included. Per game (LibraryEntry.padAssist), off by
default, in Game details > Controls and the in-game Session menu.

Applied in GamepadInput.sample() after the touch merge (before the key feed
in keyboard-and-mouse mode), so XInput, the HID controller and the stick
mouse all see it. tests/host/check-pad-assist.py covers the math.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwPPpuvHgthsPVrzyCSq1P
Signed-off-by: ft7t8drgwf-wq <337626868+ft7t8drgwf-wq@users.noreply.github.com>
Build 38's first test had no controller and no touch controller in a mouse
game: player 1 did not exist, so the right stick gyro aim fed had nowhere to
go and the sampler never ran. Gyro aim now has a Moves choice (Automatic,
Right stick, Mouse). Automatic moves the mouse with no controller for the
game, or in keyboard-and-mouse mode, and the right stick otherwise; the 4 ms
poll runs for it without a pad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwPPpuvHgthsPVrzyCSq1P
Signed-off-by: ft7t8drgwf-wq <337626868+ft7t8drgwf-wq@users.noreply.github.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