Commit Graph

6275 Commits (2c518747b9cf45c1b94c570c19912e04476e8eed)

Author SHA1 Message Date
Sam Lantinga 2c518747b9 Added microsecond timestamp to sensor values for PS4 and PS5 controllers using the HIDAPI driver 2022-09-27 09:56:49 -07:00
Sylvain d71df6448b
Fixed bug #6287 - SDL_FillRect failed for SDL_Surface with BitsPerPixel == 4 2022-09-27 10:21:15 +02:00
Sam Lantinga 1e1be0b954 Updated logic to match between PS4/PS5/Switch controllers 2022-09-26 23:00:58 -07:00
Sam Lantinga 8c40a6b0c7 Drop PS5 Bluetooth reports that fail CRC check 2022-09-26 22:47:21 -07:00
Sam Lantinga db075ff3ba Removed unused variable 2022-09-26 22:45:01 -07:00
Sam Lantinga 2ccdd0667a Handle DS4 dongle controller connection and disconnection
We also drop Bluetooth packets that fail the CRC check, as recommended by Sony
2022-09-26 22:34:33 -07:00
Sam Lantinga 18046b9aa3 Fixed crash with a NULL serial number 2022-09-26 20:53:50 -07:00
Sam Lantinga 67fa6a935f Don't wait a long time for zombie Bluetooth controllers
If a Nintendo Switch Pro controller is turned off, it will leave the controller connected in Windows, but not responding to reports. Don't wait a really long time trying to get information from a controller in this state.
2022-09-26 20:49:26 -07:00
Sam Lantinga 67db8a9103 Wait for input before reconnecting a Bluetooth device
On Windows, the Bluetooth device can remain in a connected state if the controller just shut down. It won't return any errors, but it also won't generate any input reports in this state, so wait until we know for sure that the Bluetooth controller is sending data before letting the application know it's available.
2022-09-26 20:43:46 -07:00
Cameron Gutman 71fb91f7e4 evdev: Fix build with libudev and joystick subsystem disabled 2022-09-26 21:38:09 -05:00
Sam Lantinga 2cc9176137 Removed debug logging 2022-09-26 18:52:26 -07:00
Sam Lantinga 2c98c8af01 Use better default values for Switch controller calibration 2022-09-26 18:39:47 -07:00
Sam Lantinga a205c5e26c Use separate extents for simple and advanced reports 2022-09-26 18:39:47 -07:00
Sam Lantinga 4e375996d3 Added a hint to return the version in the old format
Workaround for https://github.com/libsdl-org/SDL/issues/6177 for games that can't be updated.
2022-09-26 17:06:18 -07:00
Sam Lantinga b7fddb4c0e Minor tweaks 2022-09-26 14:39:51 -07:00
Sam Lantinga 39adcc0a6b Prefer USB input over Bluetooth for PS5/PS5/Switch controllers
Nintendo Switch controllers will automatically turn off Bluetooth when connected over USB, but this takes care of that a little more quickly.

PS4 and PS5 controllers will happily send reports over both Bluetooth and USB, so we'll prefer USB if connected and switch back to Bluetooth if USB is disconnected.
2022-09-26 14:20:34 -07:00
Sam Lantinga 17d7d03adf Added detection of the joystick type for third party PS4 and PS5 controllers 2022-09-26 08:12:35 -07:00
Sam Lantinga 8d2cb1555e Added an entry for the ZEROPLUS P4 Wired Gamepad 2022-09-23 16:56:24 -07:00
Sam Lantinga cb063db64f Moved XInputPS4 controllers into the PS4 controller section 2022-09-23 16:52:37 -07:00
Sam Lantinga 5b3b7e6e7c Separated PS4/PS5 effects support into individual capabilities 2022-09-23 16:46:36 -07:00
Sam Lantinga 33619aa2e9 Added support for the ZEROPLUS P4 Wired Gamepad to the HIDAPI driver 2022-09-23 16:38:15 -07:00
Sam Lantinga e888c99fa6 Fixed the entry for the Nacon PS4 Compact Controller 2022-09-23 16:26:41 -07:00
Sam Lantinga 4ea64fee9f Fixed manufacturer/product name deduplication for the Razer Raiju Tournament Edition controller 2022-09-23 15:29:00 -07:00
Sam Lantinga 56b91ea720 Fixed feature detection for the Razer Raiju Tournament Edition controller 2022-09-23 15:29:00 -07:00
Frank Praznik 4a06cc0f75 wayland: Apply modifier changes to the text of repeated keys
The text component of a repeated keystroke is initially set when a key is first pressed and the cached value remains static until the repeated key is released and another repeatable key is pressed. If the state of a modifier such as shift or capslock is changed while a key is being repeated, the text emitted will not have the modifier applied to it until the repeated key is released and pressed again.

Update the text to be repeated by a key if a modifier is changed while a key is actively being repeated.
2022-09-23 13:40:51 -04:00
Frank Praznik 467c82c771 wayland: Add mappings for the Escape and NumLock keys
The XKB keysym to SDL keycode mappings were missing for the Escape and NumLock keys, which prevented them from being remapped. Add them to the table so that the remapping of these keys will work.
2022-09-23 10:30:14 -07:00
Sam Lantinga 34f928abb7 Generate the correct name for ASTRO Gaming controllers
Manufacturer "ASTRO Gaming" and product "ASTRO C40" turns into "ASTRO C40"
2022-09-23 09:26:18 -07:00
Sam Lantinga 6ddef7c234 Generate the correct name for Qanba and Mad Catz controllers 2022-09-23 09:20:27 -07:00
Sam Lantinga c2ae2ccc32 Added feature support for the Razer Raiju to the HIDAPI driver 2022-09-23 09:11:12 -07:00
UnknownShadow200 5ea9886bcf haiku: Fix when screen color depth was 24 bits, SDL_GetWindowSurface would always fail with 'Unknown pixel format' error
Note that returning SDL_PIXELFORMAT_BGR24 instead of SDL_PIXELFORMAT_RGB24 seems necessary, otherwise when running with SDL_ACCELERATION=0, the red and blue channels of the window appeared swapped.
Note that when running with acceleration enabled, red and blue channel swapping does not happen regardless of whether SDL_PIXEL_FORMAT_RGB24 or SDL_PIXEL_FORMAT_BGR24 is returned.

For good measure, I also tested running with acceleration disabled in both 15 and 16 bit color depths, but red and blue channel swapping did not occur
2022-09-23 02:51:00 -07:00
Sam Lantinga 51fefd1c35 Added support for third party PS3 controllers to the HIDAPI driver 2022-09-23 02:39:35 -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 1d34a5249d Fixed shadowed variable warning 2022-09-23 00:38:23 -07:00
Sam Lantinga 010d3e6442 Fixed function prototype mismatch 2022-09-23 00:36:46 -07:00
Sam Lantinga b7940c29cc Allow HIDAPI controllers to override the default joystick type 2022-09-23 00:15:40 -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 2857e3c748 Added an entry for the Mad Catz FightStick TE 2+ PS3 2022-09-22 15:53:32 -07:00
Sam Lantinga 6812f1b5d7 Fixed the entry for the HORI Fighting Commander 4 in PS4 mode 2022-09-22 15:16:34 -07:00
Sam Lantinga 99e85cc27b Accidentally reverted 172865ff13 2022-09-22 10:10:20 -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
Frank Praznik 399cb2f0de wayland: Only clear the key repeat flag when the repeated key is released
If multiple keys were simultaneously depressed and one was being repeated, the repeat flag was being cleared when any of the pressed keys were released, even if the released key wasn't the one being repeated.

This tracks the key currently being repeated and only clears the repeat flag when the particular key being repeated is released.
2022-09-21 14:26:13 -07:00
Sam Lantinga eb25f6c912 Fixed Xbox platform name, courtesy of @walbourn 2022-09-21 14:22:38 -07:00
zhailiangliang 00b67f5572 Fix potential memory leak in GLES_CreateTexture 2022-09-20 20:14:01 -07:00
past-due 301912a5b9 Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinates 2022-09-21 03:40:50 +03:00
Ivan Epifanov 08a331847b Vita: fix controls on PSTV with opened IME 2022-09-20 11:03:34 -07:00
Sam Lantinga dc2a682a82 Use the right kind of 0 2022-09-20 09:22:43 -07:00
Sam Lantinga 2461930601 Fixed build on RISC OS 2022-09-20 09:16:10 -07:00