Commit Graph

2570 Commits

Author SHA1 Message Date
Nintorch
419dcfe747 Fallback for non-gamepad controllers in GameInput
This PR makes the GameInput joystick backend ignore non-gamepad controllers if DirectInput or XInput backends are enabled. This is done to prevent possible bugs and/or regressions.
2026-03-10 11:06:10 -07:00
Nintorch
0138843eb7 Small GameInput joystick backend improvements
This PR includes small improvements to the GameInput joystick backend:
- Device subtypes
- Compatibility with DirectInput joystick mappings (if the controller is not a gamepad, i.e. `GAMEINPUT_InternalIsGamepad()` returns `false`)
- Fallback to DirectInput/XInput for currently unsupported devices (force feedback ones and the ones that are neither gamepads nor controllers, I'm not sure if that's possible, but maybe racing wheels and other device subtypes would count?)
2026-03-09 11:12:00 -07:00
Sanjay Govind
101273f429 extract capabilities for 360 controllers over libusb (#15183)
Read capabilities when using xinput controllers via the libusb backend

This gives us access to the subtype on linux and macOS, and gives us a lot of data we can use for handling more detailed device types when I look into a unified api for exposing instrument data later.
2026-03-08 17:29:56 -07:00
Sanjay Govind
e610b85d1c support batteries on 3rd party controllers 2026-03-08 11:40:35 -07:00
Sanjay Govind
94f17d6c61 Add support for whammy and tilt on PS4/5 guitars
PS4/5 controllers put device specific data into a specific region in the report, so we have to extract it separately.

No known guitars use the right stick on the guitar, so to keep things working similarly to PS3, i have opted to map whammy and tilt the same way as the PS3 rb guitars.
2026-03-08 11:35:57 -07:00
Sanjay Govind
34378609bb fix off by one with tilt on ps3 guitars (#15144) 2026-03-02 09:45:44 -08:00
Brenton Bostick
3ac4e684ab make sure #endif comment matches the macro name 2026-02-28 08:43:42 -08:00
Sam Lantinga
f600c74c80 Don't enable extended features for GameSir controllers over Bluetooth 2026-02-26 09:18:07 -08:00
Sam Lantinga
170e3a81d8 Fixed the GameSir-G7 Pro 8K button mapping 2026-02-26 09:18:07 -08:00
Sam Lantinga
7775bbef9f Fixed the GameSir-G7 Pro 8K accelerometer scale 2026-02-26 09:18:07 -08:00
Sam Lantinga
862e1e8600 Fixed the GameSir-G7 Pro 8K sensor rate
The reports are delivered at 250 Hz both wired and via the wireless dongle.
2026-02-26 09:18:07 -08:00
zuiki_inn
29ca920fdf Add ZUIKI EVOTOP controller support with gyroscope and accelerometer sensor capabilities. (#15034) 2026-02-25 20:24:29 -08:00
Sam Lantinga
49a8b4229b Added battery status for newer FlyDigi controllers 2026-02-24 20:49:45 -08:00
Sanjay Govind
0c859452ef Support accelerometers on 3rd party ps3 controllers (#15109) 2026-02-24 18:58:13 -08:00
Sanjay Govind
a7ccd48957 Set joystick_type for known ps3/wii instruments (#15111) 2026-02-24 17:26:46 -08:00
Sanjay Govind
1419bcb6cb deal with controllers that don't have report ids 2026-02-24 15:18:53 -08:00
Sanjay Govind
0e4008441f Fix up controller types for various playstation and wii instruments (#15104) 2026-02-24 13:35:45 -08:00
Sam Lantinga
2385dc6297 Added support for the Flydigi Vader 5 Pro in Xbox 360 mode 2026-02-24 10:18:17 -08:00
Vicki Pfau
8a1684fbbc Support SL/SR on Switch 2 controllers, but only in mini-controller mode
It doesn't really make sense to support these in combined mode since they're usually occluded.
2026-02-24 06:52:32 -08:00
tmkk
bbcc205de9 Detect steam virtual gamepads more accurately on macOS 2026-02-22 11:11:09 -08:00
tmkk
50d0e2ede2 Bring back support for 360Controller driver on macOS 2026-02-22 11:11:09 -08:00
Sam Lantinga
67c2f61068 Support an alternate GameSir report format 2026-02-20 09:44:14 -08:00
Ryan C. Gordon
c728e2f044 emscripten: Move some EM_ASM blocks to MAIN_THREAD_EM_ASM.
These blocks reference the `navigator` global, which is not available in
background threads.
2026-02-20 10:27:44 -05:00
Sam Lantinga
129627068f Fixed HIDAPI PS5 Bluetooth report format 2026-02-17 08:57:06 -08:00
DominusExult
225fb12ae1 Hide deprecation message for controllerPausedHandler (which is still needed for backwards compatibility) 2026-02-15 10:57:07 -08:00
Sam Lantinga
79f5f674bd Use the correct report format for BLE Steam Controller reports 2026-02-12 16:02:21 -08:00
Sam Lantinga
0b1c592fda Steam Controller report 0x45 is used for BLE mode 2026-02-12 15:45:10 -08:00
Sam Lantinga
84c21cf970 Updated Steam Controller packet handling 2026-02-12 14:34:20 -08:00
Sam Lantinga
2b484a1ccb Fixed initializing the PowerA Fusion Pro 4 on Steam Link hardware 2026-02-11 16:54:18 -08:00
chenzw
85c297a28b Added IMU support for GameSir controllers with optimized sampling rate and timestamp synchronization. 2026-02-10 21:06:40 -08:00
walle
6f1aa78e04 fixed trigger axes formula: data * 257 - 32768 (same as PS4) 2026-02-10 21:06:40 -08:00
walle
226057601f fixed Clamp -(-32768) to 32767 to avoid Sint16 overflow wrapping back to -32768 2026-02-10 21:06:40 -08:00
chenzw
304fcaeec2 SendGameSirModeSwitch code cleanup 2026-02-10 21:06:40 -08:00
chenzw
6ae268ba17 Remove GameSir-G7 Pro 2026-02-10 21:06:40 -08:00
Sam Lantinga
71f4af7322 Eliminate contention between HIDAPI controller reads and writes
Rumble can often take a long time, and it is theoretically safe to simultaneously read and write hidapi devices on all platforms.

Fixes https://github.com/libsdl-org/SDL/issues/9441
2026-02-10 09:38:19 -08:00
Sam Lantinga
9f8c70713a Fix the 8BitDo Ultimate 2D Wireless Controller showing up multiple times
This controller has 3 interfaces, one for the Xbox gamepad protocol, and two HID interfaces. We should only handle the Xbox interface in the Xbox driver.
2026-02-09 13:28:45 -08:00
RaceTheMaSe
f1a7a64eb4 Fix warnings: Extra semi - macro usage (#15015) 2026-02-08 16:58:53 -08:00
Vicki Pfau
017d950b6b Fix Switch and Switch 2 player LED patterns
The patterns we were using don't match the official patterns, which fill up as
many lights as players instead of just using the nth player LED. Above 4,
there are some special patterns, as documented on Nintendo's Singaporean site:
https://www.nintendo.com/sg/support/qa/detail/33822
2026-02-07 07:37:25 -08:00
Vicki Pfau
e1b8ad0380 Add and use libusb_set_auto_detach_kernel_driver for the Switch 2 driver 2026-02-05 14:58:15 -08:00
Sam Lantinga
0cadc15ef6 Don't treat "hid-over-i2c 0107 System Control" as a joystick 2026-02-05 11:27:05 -08:00
Sam Lantinga
273a093032 Temporarily disable GameSir driver
There are some issues that need response from GameSir before this can be enabled by default.
2026-02-04 15:53:01 -08:00
Sam Lantinga
ca7788cd9f Fixed spacing 2026-02-04 15:53:01 -08:00
Sam Lantinga
d43d29269d Added support for GameSir simple report mode 2026-02-04 15:53:01 -08:00
Sam Lantinga
8a9722e9f4 Removed GameSir trigger rumble
This doesn't appear to actually be supported by the hardware, and used the same report as normal rumble.
2026-02-04 15:53:01 -08:00
Sam Lantinga
883066228b Minor code cleanup
- the connection type is already set correctly based on bluetooth connection state
- removed some verbose controller type logging
- device and ctx are guaranteed not to be NULL at the driver level
2026-02-04 15:53:01 -08:00
Sam Lantinga
1a99861510 Fixed warnings building on Android 2026-02-04 14:55:29 -08:00
Sam Lantinga
cd14bf3d00 Fixed warning: no previous prototype for function 'SDL_PrivateIsGamepadPlatformMatch' 2026-02-04 14:40:42 -08:00
chenzw
1fd7cd693a pass payload to state handler 2026-02-03 20:09:04 -08:00
chenzw
8272699901 refactor(joystick): unify GameSir packet parsing with packet/payload offsets, fix field byte indexing and standardize length checks 2026-02-03 20:09:04 -08:00
chenzw
e087de5741 refactor for style (no functional changes) 2026-02-03 20:09:04 -08:00