Repository navigation
Controllers: gyro aim and turbo for player 1 - #485
Open
insertfloppy wants to merge 2 commits into
Open
insertfloppy wants to merge 2 commits into
insertfloppy wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PadAssist.swift). Gyro aim addsthe 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()afterthe touch merge, so XInput, the HID controller and the stick mouse all see
it. Settings live in
LibraryEntry.padAssist.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 recordeach session's choices. tests/host/check-pad-assist.py covers the math
(settings decoding, gyro scaling, the anti-dead zone, turbo timing).
Testing
using the device's gyro to move the mouse, works. Turbo and gyro from a
physical controller weren't part of that test.
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