Sam Lantinga
9c3aa7f055
SDL: fix packet handling for original version of Stadia FW
2021-02-10 10:22:20 -05:00
Cameron Gutman
f4d58689e0
Fix Xbox Series X controller on macOS
...
There were two different implementations of IsBluetoothXboxOneController(), one
in SDL_hidapi_xbox360.c and one in SDL_hidapi_xboxone.c. The latter had been
updated to include USB_PRODUCT_XBOX_ONE_SERIES_X_BLUETOOTH while the former had
not.
This mismatch led to the Xbox Series X failing on macOS only. We have special
code for handling the 360Controller driver for macOS which requires us to use
the Xbox 360 driver for wired Xbox One controllers, and the SDL_hidapi_xbox360
version of IsBluetoothXboxOneController() was used to determine which devices
were wired.
In addition to adding the missing USB_PRODUCT_XBOX_ONE_SERIES_X_BLUETOOTH, this
change moves IsBluetoothXboxOneController() into a single shared function which
will ensure this bug won't happen again.
2021-02-10 10:22:19 -05:00
Sam Lantinga
85235985fb
Fixed detecting the paddles on the Xbox Elite Series 1 controller
2021-02-10 10:22:19 -05:00
Sam Lantinga
2cc70ca39e
Fixed crash if the GameCube controller hasn't been opened yet
2021-02-10 10:22:18 -05:00
Sam Lantinga
7f710e93f0
Make sure we don't create a game controller mapping for HID devices that aren't supported by HIDAPI
2021-02-10 10:22:18 -05:00
Sam Lantinga
d81eaf8da5
Added explicit case from Uint8 to int before subtracting offset
2021-02-10 10:22:17 -05:00
Sam Lantinga
bec9d740ec
Fixed compile warning
2021-02-10 10:22:17 -05:00
Sam Lantinga
ac72a2ba8e
Fixed bug 5493 - Hint to let the user opt out of having Switch controllers' Home button lit when opened
...
jibb
New hint to let the user opt out of having Switch controllers' Home button lit when opened.
This is more consistent with the Switch itself (which doesn't light the button normally) and may be preferred by users who may disconnect their controller without letting the application close it.
I think this warrants a Switch-specific hint because the default behaviour is unusual (inconsistent with using a Switch controller on a Switch itself or with some other programs on PC), and because of that it's distinct from other lights (the player number on Switch controllers and the player colour on PlayStation controllers).
2021-02-10 10:22:16 -05:00
Sam Lantinga
c857b5e0c9
Minor cleanup
2021-01-24 00:51:26 -05:00
Sam Lantinga
1981d23f4b
Fixed bug 5466 - Add haptic support for Stadia Controller
...
Dimitriy Ryazantcev
Consider adding support for Stadia Controller haptics.
Here is example code how to deal with it:
99314be815/device/gamepad/hid_haptic_gamepad.cc (L45)
2021-01-24 00:51:26 -05:00
JibbSmart
0f57864c9e
Hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS added so we can recognise a Joy-Con as half a Pro Controller, so we can read its analog input and read its sensors just like we do a Pro Controller.
2021-01-24 00:51:25 -05:00
Sam Lantinga
f68b36df75
Added support for the EVORETRO GameCube Adapter in PC mode
2021-01-24 00:51:25 -05:00
Sam Lantinga
9e45372a2f
Fixed build on Android and iOS
2021-01-24 00:51:25 -05:00
Sam Lantinga
3527b49459
Fixed initializing the Nyko and EVORETRO GameCube adaptors
...
This requires root on most Linux distributions, as we have to directly send USB messages to the devices to enable input reports.
2021-01-24 00:51:24 -05: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
Ozkan Sezer
bdb3e6b84f
SDL_hidapi_switch.c: fix build with older compilers
2021-01-15 12:40:00 +03:00
Sam Lantinga
e3dbae5010
Get the serial number for the Nintendo Switch Pro controller
2021-01-14 23:49:41 -08:00
Sam Lantinga
5fc743c4fd
Phantom Nintendo Switch Pro Controller initialization problem
2021-01-14 23:49:37 -08:00
Sam Lantinga
92742306a6
Fixed rumble reset failing for Switch Pro controllers in USB mode
2021-01-14 23:49:33 -08:00
Sam Lantinga
d0b87fede6
Added HIDAPI rumble debug info
2021-01-14 23:49:27 -08: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
907b8eebc3
Make sure the HIDAPI device is locked when closing it, in case there is rumble pending that didn't complete
2021-01-14 23:49:16 -08:00
Sam Lantinga
fbd7c718b6
Don't blink the Xbox 360 LED when setting the player slot, it's probably already been set by a driver
2021-01-13 11:02:07 -08:00
Sam Lantinga
d757ec7f5c
Only select the gamepad interfaces on the Xbox 360 wireless adapter
2021-01-13 11:02:01 -08:00
JibbSmart
e9887045a2
Gyro and Accel sensor support for Switch Pro Controller.
...
Note that axes are changed to match the axes we're using with PlayStation controllers, since users will appreciate consistent behaviour across devices.
2021-01-11 15:36:40 +08:00
Sam Lantinga
a5dba7d3ab
Fixed Xbox One Series X share button incorrectly triggering on newer firmware
2021-01-08 09:54:52 -08:00
Sam Lantinga
b2a0c712cb
Allow setting the player index to -1, which turns off the player LED for PS5 controllers
2021-01-04 12:24:44 -08:00
Sam Lantinga
bf754b52bf
Valve contributed code is under the Zlib license
2021-01-04 12:17:24 -08:00
Sam Lantinga
9130f7c377
Updated copyright for 2021
2021-01-02 10:25:38 -08:00
Sam Lantinga
480c1f9fef
Make sure we're not starving report reads when there's lots of rumble
2021-01-01 11:12:36 -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
e65e4fd3ef
Fixed detecting the guide button on Xbox One S controllers over Bluetooth on Linux
2020-12-14 09:48:51 -08:00
Sam Lantinga
80e5c689eb
Fixed the PS5 controller not disconnecting when powered off
2020-12-13 01:20:38 -08:00
Sam Lantinga
cb36189692
Fixed bug 5235 - All internal sources should include SDL_assert.h
...
Ryan C. Gordon
We should really stick this in SDL_internal.h or something so it's always available.
2020-12-09 07:16:22 -08:00
Sam Lantinga
c9723c407f
Fixed potential hang in joystick close if the rumble thread is blocked for some reason
...
It's still possible to hang when shutting down, if the rumble thread is still hung, but it won't block indefinitely at runtime.
2020-12-07 09:38:21 -08:00
Sam Lantinga
09909d029d
Fixed handling of BACK button on newer Xbox One S controllers
2020-12-03 19:44:47 -08:00
Sam Lantinga
54e5136b50
Refactored Xbox One Bluetooth protocol and verified Xbox One S, Xbox Series X, and Xbox One Elite Series 2 controllers
2020-12-03 18:17:04 -08:00
Sam Lantinga
1031231b29
Fixed duplicating a device between XInput and HIDAPI
2020-12-03 18:17:03 -08:00
Sam Lantinga
59f28b7f4b
Fixed whitespace
2020-12-03 18:17:01 -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
a0c5bfa3bd
Moved raw input event processing from the main thread to the joystick thread
...
This allows fast joystick event delivery regardless of what the main thread is doing.
2020-11-27 13:08:40 -08:00
Sam Lantinga
ce77966da8
Fixed RAWINPUT_IsDevicePresent() not returning TRUE for Xbox One controllers
2020-11-27 10:44:49 -08:00