flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.29k stars 161 forks source link

[Feature request] Native gyro to lightgun/ mouse support #1476

Open RiasatSalminSami opened 3 months ago

RiasatSalminSami commented 3 months ago

Dual shock 4, Dual Sense and Switch controllers support gyro. This can be utilized to emulate lightgun cursor just like mouse. This should make lightgun games much more comfortable to play with gyro supported gamepads.

Basic implementation with the ability to set X-axis to roll or yaw and having a calibration+ deadzone threshold should do the job for basic lightgun implementation.

Current alternatives to achieve this behaviour are Steam input by using steam, DS4windows app, etc. At the moment it's already possible to use DS4windows and Steam input to emulate mouse cursor via Gyro and this works really well. However, there is one major limitation with this method: none of these methods treat gamepad's gyro as a separate HID mouse. This means it's impossible to use them via raw input. Without raw input, it's impossible to play with 2 players. This is why native support will be very useful for 2 player mode.

Preview of gyro aiming: https://youtu.be/jETuNOF0XQc