Idea: Adopt PrimeRecomp's direct-HID gyro implementation #2974
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#2974
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The idea
I'd like to request expanding Longshot's native gyroscope support to allow reading physical controller motion data directly, even when Steam Input is enabled and exposing a virtual Xbox controller.
Problem Statement:
When launching a game through Steam with Steam Input enabled, Steam frequently exposes a virtual controller that lacks accelerometer and gyroscope sensors.
SDL may consequently see only this virtual controller, preventing applications like Longshot from receiving the physical controller's motion data.
Disabling Steam Input can restore native sensor access in some cases, but sacrifices Steam Input's useful button remapping, trackpad configuration, controller profiles and other functionality.
Ideally, Longshot should support native motion aiming without requiring users to choose between Steam Input and gyro functionality.
Proposed solution:
Adapt or take inspiration from PrimeRecomp's direct-HID motion reader.
PrimeRecomp recently implemented this functionality for Metroid Prime Remastered, including explicit support for the new 2026 Steam Controller on Windows and Linux.
This seems like an excellent reference for extending Longshot's existing Steam Deck-specific gyro workaround.
Reference implementation:
PrimeRecomp — Direct gyro through Steam Input
Implementation commit:
github.com/gminustwo/primerecomp@37d36e5882Original feature discussion: https://github.com/gminustwo/primerecomp/issues/73
Motion implementation: https://github.com/gminustwo/primerecomp/blob/main/runtime/hle/motion.c
Windows HID implementation: https://github.com/gminustwo/primerecomp/blob/main/runtime/platform/windows.c
Related Longshot work:
Steam Deck direct IMU commit:
c6022bcdc9Existing DSU/Cemuhook request: #2733
PrimeRecomp separates controller input into two paths:
Buttons, triggers and analog sticks: Continue using the Steam Input virtual controller through SDL.
Gyroscope and accelerometer: Read motion reports directly from the underlying physical controller when SDL's active controller does not expose usable sensors.
The implementation uses read-only access to HID input reports so that Steam can continue managing mappings, trackpads, LEDs and controller configuration.
On Windows, it uses cfgmgr32 device enumeration and ReadFile, avoiding the standard HID discovery APIs that Steam's overlay can intercept.
On Linux, it reads controller reports through /dev/hidraw.
It supports multiple device families and converts their motion reports into values compatible with SDL's sensor conventions.
Requested controller support
Ideally:
Steam Controller (2026), including USB, Bluetooth and wireless receiver connections
Steam Deck built-in controls
DualSense / DualSense Edge
DualShock 4
Switch Pro Controller
Joy-Con
The original 2015 Steam Controller would also be a welcome addition if feasible, although PrimeRecomp's referenced direct reader does not currently implement it.
PrimeRecomp identifies the 2026 Steam Controller using Valve vendor ID 0x28DE and product IDs 0x1302–0x1305.
Suggested behavior:
Prefer native SDL motion sensors whenever available.
Fall back to direct HID motion when Steam Input's virtual controller lacks gyro data.
Keep Steam Input responsible for buttons and analog controls.
Avoid modifying the physical controller's operating mode or settings.
Provide a toggle to disable direct HID reading for troubleshooting.
Display the active motion source in Longshot's controller settings or logs.
Avoid double-counting motion if both SDL and HID provide sensor readings.
Re-detect sensors after disconnect/reconnect or sleep/resume.
Suggested acceptance criteria:
A user can launch Longshot through Steam on Windows with Steam Input enabled.
A supported physical controller's gyroscope works for native aiming without gyro-to-mouse mapping.
Steam Input's regular button, stick and trackpad mappings continue functioning.
The same behavior works under Linux where supported HID access is available.
Unsupported controllers fall back gracefully to existing input handling.
Thanks for considering it!
Anything else
No response
Possibly related, for context:
From Discord:
A user on Bazzite reports an 8BitDo Pro 3 is not detected in Direct Input mode in Longshot (including menu movement and binding setup), although it worked in Direct Input with gyro in the last Hookshot release. Enabling Switch Pro Controller mode on the pad makes it work without Steam Input. This is a report of non-Steam-Input controller detection, distinct from the Steam Input gyro issue tracked here.
From Discord:
The reporter confirms that disabling Steam Input / using the workaround made motion aiming work.