Sam Lantinga
5b3b7e6e7c
Separated PS4/PS5 effects support into individual capabilities
2022-09-23 16:46:36 -07:00
Sam Lantinga
5b4c10fc7b
Return true from IsSupportedDevice if it's a device that we _might_ support
...
This forces an update of the device list so we have the correct state when we check to see whether a device is being handled by HIDAPI
2022-09-23 02:36:53 -07:00
Sam Lantinga
899a1e7cba
Skip PS4/PS5 probe message if we already know it's a supported controller
2022-09-22 23:54:26 -07:00
Sam Lantinga
fa2063fb44
Improved detection of third party PS4 and PS5 controllers
2022-09-22 23:42:25 -07:00
Sam Lantinga
aa2e2f4843
Make sure HID devices can be opened before making them available to the application
...
This prevents a number of issues where devices are enumerated but not actually able to be opened, like https://github.com/libsdl-org/SDL/issues/5781 .
We currently leave the devices open, allowing us to more easily do controller feature detection, protocol negotiation, detect dropped Bluetooth connections, etc. with the expectation that the application is likely to open the controllers shortly.
2022-09-22 18:27:38 -07:00
Sam Lantinga
6cbdc66650
Fixed use of uninitialized 'size' variable (thanks @ozkan!)
2022-09-22 09:05:06 -07:00
Sam Lantinga
0c4594ac72
Improved PS4 and PS5 third-party controller feature detection
2022-09-22 06:45:46 -07:00
Sam Lantinga
2e9f5b5989
Added support for the HORI Fighting Commander OCTA (Xbox Series X and PS versions)
2022-09-16 15:41:35 -07:00
Sam Lantinga
5770e87cb2
Fixed regression handling touchpad input with PS5 controllers using the original shipping firmware
2022-09-02 13:57:59 -07:00
Sam Lantinga
cdaafcec0d
The Kinvoca Joy-Cons are handled by the Joy-Con driver, not the Switch Pro driver.
2022-08-30 14:56:11 -07:00
Sam Lantinga
b2ac758f61
Added support for the Hori Fighting Stick Alpha to the HIDAPI driver
2022-08-29 17:33:00 -07:00
Sam Lantinga
52b6899a6b
Added hints for more fine grained control over HIDAPI Xbox controller support
2022-08-19 11:11:23 -07:00
Sam Lantinga
5545be8530
The player LED index wraps for PS5 controllers, like it does for other controller types
2022-08-08 23:44:50 -07:00
Sam Lantinga
b0e827fb65
Enable improved rumble emulation on DualSense(tm) Wireless Controllers with firmware version 2.24 and newer
2022-06-17 07:55:53 -07:00
Sam Lantinga
68544be44b
Added support for the Nintendo Online controllers
2022-06-10 11:31:59 -07:00
Sam Lantinga
9202df0472
Implemented SDL_GameControllerGetFirmwareVersion() for HIDAPI PS5 controllers
2022-06-09 18:11:34 -07:00
Sam Lantinga
2ca0837888
SDL: sometimes the PS5 controller doesn't report having to power even when connected over USB. Possibly related to being completely charged? Either way we already know that it's USB or BT so let's use the driver's knowledge instead.
2022-04-22 14:21:41 -07:00
Cameron Gutman
2c04df8d65
joystick: Fix rumble issues on PS5 HIDAPI controllers
...
We were returning the report size from HIDAPI_DriverPS5_RumbleJoystick() rather
than 0 upon success, causing SDL_JoystickRumble() (and callers) to think that
rumbling failed.
This didn't cause major problems until 1868c5b , when it started preventing
rumble state from being persisted in the joystick core, even though it was
successfully sent to the hardware.
This led to all sorts of strangeness, including broken rumble duration and
attempts to stop rumble being discarded.
2022-03-30 18:33:38 -05:00
Sam Lantinga
120c76c84b
Updated copyright for 2022
2022-01-03 09:40:21 -08:00
Sam Lantinga
66058bbbd5
Fixed exception accessing Bluetooth devices on Android 12
...
Since accessing Bluetooth prompts the user for permission on both Android and iOS, and we only need it for Steam Controller support, we'll leave it off by default. You can enable it by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()
Fixes https://github.com/libsdl-org/SDL/issues/4952
2021-11-15 16:52:56 -08:00
Ozkan Sezer
6ad0fb8462
SDL_hidapi_ps4.c, SDL_hidapi_ps5.c: use SDL_zeroa()
2021-11-13 17:55:10 +03:00
Cameron Gutman
afccabb881
joystick: Add capability flags for rumble and trigger rumble
...
When API limitations force us to guess, we favor a false positive (reporting
support when it doesn't exist) compared to a false negative.
2021-11-11 15:10:08 -08:00
Cameron Gutman
1ccfbf963e
joystick: Convert HasLED() into a generic GetCapabilities() function
2021-11-11 15:10:08 -08:00
Sam Lantinga
5b646cd19e
Build hidapi code into SDL as a new public API
...
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
2021-11-07 23:00:59 -08:00
Sam Lantinga
a186a503e7
Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller.
2021-07-29 06:43:39 -07:00
Sam Lantinga
384d86b584
Fixed compile warnings with Visual Studio
2021-07-23 23:48:23 -07:00
Sam Lantinga
d135c0762f
Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers
...
See testgamecontroller.c for an example of a custom PS5 trigger effect
2021-07-08 13:22:41 -07:00
Sam Lantinga
333c8e75f1
The PS5 driver supports Joystick LED
2021-05-17 11:54:05 -07:00
Cameron Gutman
6e97170e96
Use PS4 rumble hint as the default for the PS5 rumble hint
...
Existing SDL applications may not know about the need to set a specific
hint to enable rumble on PS5 controllers, even though they may already
set the equivalent SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE hint for PS4
controller rumble support.
Rather than requiring those developers update their apps, let's use the
SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE value as an indication of the behavior
they are expected for all PlayStation controllers.
2021-01-24 00:51:24 -05:00
Sam Lantinga
e2f46ed8ef
Always lock the HIDAPI device when closing, in case rumble is pending
2021-01-14 23:49:20 -08:00
Sam Lantinga
9130f7c377
Updated copyright for 2021
2021-01-02 10:25:38 -08:00
Sam Lantinga
0684572ccc
Added a hint to control whether the player LEDs should be lit to indicate which player is associated with a PS5 controller.
2020-12-29 12:13:10 -08:00
Sam Lantinga
0ed4d92938
Fixed setting player LEDs for PS5 controllers over Bluetooth
2020-12-23 04:53:23 -08:00
Sam Lantinga
6341bb35a5
Fixed controller disconnect detection for PS4 and PS5 controllers over Bluetooth
2020-12-22 21:51:59 -08:00
Sam Lantinga
a30adae567
Make it possible to turn on PS4 rumble effects at runtime using the hint
2020-12-22 20:58:32 -08:00
Sam Lantinga
c93947a2cb
Make it possible to turn on PS5 rumble effects at runtime using the hint
2020-12-22 20:12:03 -08:00
Sam Lantinga
058a0ab47f
Set the pad lights on the PS5 controller corresponding to the player index
...
Also allow setting the player index from testgamecontroller using the number keys
2020-12-22 14:38:32 -08:00
Sam Lantinga
6a57072eef
Only add the touchpad and sensors to the PS5 controller if effects are enabled
2020-12-22 14:10:08 -08:00
Sam Lantinga
4ec776c334
Don't switch the PS5 controller out of DirectInput mode by default
2020-12-22 13:29:23 -08:00
Sam Lantinga
80e5c689eb
Fixed the PS5 controller not disconnecting when powered off
2020-12-13 01:20:38 -08:00
Sam Lantinga
e3966e25ca
Use the correct internal API for updating the battery level for PS5 controllers
2020-11-30 13:04:30 -08:00
Sam Lantinga
f4ed07de06
We don't know whether the PS5 controller is Bluetooth or not when we open it
2020-11-30 13:02:34 -08:00
Sam Lantinga
e44bf8a080
Fixed bug 5359 - Incorrect sensor data from DualShock4
...
multiply gyro values by sensitivity
When the hardware calibration fails, values read from sensors need to be multiplied by default sensitivity (16 for gyro, 1 for accelerometer).
2020-11-23 21:18:37 -08:00
Sam Lantinga
5b3616c325
Generalized the raw input controller driver and moved XInput/WGI detection into it for XInput devices
...
This fixes bad report parsing for various newer Xbox controllers, and this driver is now preferred over XInput, since it handles more than 4 controllers.
2020-11-23 18:24:05 -08:00
Sam Lantinga
870841c414
Reset the LED state after Bluetooth connection has completed on the PS5 controller
2020-11-21 11:59:01 -08:00
Sam Lantinga
549010f2a0
It takes 2 packets to stop audio haptics and start emulated rumble on the PS5 controller
2020-11-20 13:24:49 -08:00
Sam Lantinga
c9b097e659
Clarify the meaning of the rumble enable bits for the PS5 controller
2020-11-19 13:31:16 -08:00
Sam Lantinga
c85623d790
Re-enable haptic audio after rumble on PS5 controller
...
Also make sure we don't set any other state when we're not intending to, and added more interesting effects which are currently not exposed via API
2020-11-19 13:10:14 -08:00
Sam Lantinga
8c3196da60
Fixed some compiler warnings
2020-11-18 21:33:11 -08:00
Sam Lantinga
463d84a860
Added support for the PS5 controller gyro and accelerometer
2020-11-17 10:56:56 -08:00