1381 Commits

Author SHA1 Message Date
Sam Lantinga
201484ff6f Don't duplicate the serial number twice if a child doesn't set one 2022-08-09 09:03:28 -07:00
Sam Lantinga
d90c0d41cc Include the child serial numbers in the serial number for a HIDAPI combined device 2022-08-09 09:00:56 -07:00
Sam Lantinga
55882e43c4 Fixed invalid read when SDL_GameControllerSetPlayerIndex() is passed a negative player_index 2022-08-09 00:19:02 -07:00
Sam Lantinga
df537a7c0e SDL_GameControllerSetPlayerIndex(gamecontroller, -1) means turn off the player LED if possible 2022-08-09 00:18:19 -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
593d20d9cc Removed debug logging 2022-08-08 20:11:43 -07:00
Sam Lantinga
6204ae5002 Restart the IMU if the controller stops sending gyro/accel data 2022-08-08 20:10:12 -07:00
Sam Lantinga
d58bec72a0 Fixed Joy-Con gyro axes in mini-gamepad mode 2022-08-08 17:19:33 -07:00
Shawn Hoffman
5aa438e80a WGI: fix interop with applications that have their own WGI code
QI for Added/Removed events need to handle IAgileObject
2022-08-08 15:53:57 -07:00
Sam Lantinga
ada55c690d Fixed Joy-Con type detection for the Nintendo Joy-Con Charging Grip 2022-08-08 15:38:19 -07:00
Sam Lantinga
47ebf0087a Fixed shadow variable warning 2022-08-08 08:36:17 -07:00
Francisco Javier Trujillo Mata
0a307628e6 Fix wrong mapping in some ps2 controller keys 2022-08-08 08:32:11 -07:00
Sam Lantinga
8f05b4f833 Fixed iOS/tvOS build 2022-08-08 08:26:21 -07:00
Sam Lantinga
878259722f Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers 2022-08-08 08:22:20 -07:00
Sam Lantinga
4f19421ed8 Fixed build 2022-08-07 20:17:40 -07:00
Sam Lantinga
29265d0738 Use SDL_GetStringBoolean() to parse the hint value 2022-08-07 18:49:30 -07:00
Sam Lantinga
198d62d813 joystick: remove unused Xbox Controller Keyboard VID/PID.
0x045e, 0x0b02 - is actually virtual keyboard that is generated by XboxGip drivers for Xbox One Controllers.

Closes https://github.com/libsdl-org/SDL/pull/5121
2022-08-06 23:53:18 -07:00
Sam Lantinga
52bf5b1de9 Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED is set on Nintendo Switch controllers 2022-08-06 10:34:19 -07:00
Sam Lantinga
f810dede16 Fixed comment so script processing works correctly 2022-08-06 09:50:13 -07:00
Francisco Javier Trujillo Mata
3da131c1c6 Check if port if closed and open it again 2022-08-05 17:44:59 -07:00
Sam Lantinga
d6a8b43cf7 Added support for the HORIPAD FPS for Nintendo Switch 2022-08-05 10:37:38 -07:00
Sam Lantinga
4a9ceb7be9 The HORIPAD S uses the Xbox 360 protocol on all platforms and shows up as multiple styles of controller, depending on what model you have. 2022-08-04 11:33:36 -07:00
Sam Lantinga
28c01955bc Fixed button mapping for the HORIPAD S
This controller actually comes in at least two flavors: a GameCube controller and an arcade pad, neither of which should have the face buttons remapped.
2022-08-04 10:46:37 -07:00
Sam Lantinga
40b7143180 Fixed button mapping for the HORIPAD S controller
This controller looks like a GameCube controller, is actually a Nintendo Switch controller, and shows up as an XInput device on Windows with the buttons already in the correct location.
2022-08-04 10:26:10 -07:00
Sam Lantinga
43b90484c9 Retry a little longer when writing to the Nintendo Joy-Con Charging Grip 2022-08-04 00:40:38 -07:00
Sam Lantinga
dfd2c574d7 Removed unused variable 2022-08-03 22:27:43 -07:00
Sam Lantinga
a2b4f4406f The Nintendo Wii Remote Pro Controller respects the SDL_GAMECONTROLLER_USE_BUTTON_LABELS hint 2022-08-03 22:27:42 -07:00
Sam Lantinga
c84dea0943 Fixed detecting the controller type of controllers over USB 2022-08-03 22:12:21 -07:00
Sam Lantinga
ba297f12cd Use the Nintendo controller type to determine whether to always use button labels 2022-08-03 21:46:01 -07:00
Sam Lantinga
946f4777f6 Don't set Bluetooth controllers to wired power level 2022-08-03 21:33:38 -07:00
Sam Lantinga
57c3b2c950 Don't rely on the device VID/PID to get the Nintendo controller type
The Nintendo Online Sega Genesis controller reports the SNES VID/PID over Bluetooth. This is a more robust way of handling future controllers as well, so let's go with this instead.

Also use full reports over Bluetooth, and don't report gyro for Nintendo Online classic controllers.
2022-08-03 21:31:12 -07:00
Sam Lantinga
b6aadb16b9 Added k_eSwitchDeviceInfoControllerType_N64 to ESwitchDeviceInfoControllerType 2022-08-03 20:38:33 -07:00
Sam Lantinga
bdfb32de3c Added some additional Nintendo controller types to ESwitchDeviceInfoControllerType 2022-08-03 20:30:58 -07:00
Sam Lantinga
ea7fbf7947 Update in-flight SDL_CONTROLLERDEVICEADDED messages when a device is removed
This fixes the application trying to open the wrong device index when a device is removed and another has just been added
2022-08-03 19:39:37 -07:00
Sam Lantinga
5d50fa52df Fixed timeout opening the Nintendo Joy-Con Charging Grip
Sometimes opening the right Joy-Con takes a little longer for some reason
2022-08-03 19:39:36 -07:00
Sam Lantinga
29cdb2c9c9 Added support for the Nintendo Switch Joy-Con Charging Grip 2022-08-03 18:01:10 -07:00
Sam Lantinga
a8120104ad The Nintendo Online classic controllers and Joy-Cons shouldn't show up as Switch Pro controllers 2022-08-03 13:53:49 -07:00
Sam Lantinga
6e1ee1d4a5 sort the controller names 2022-08-03 13:51:25 -07:00
Sam Lantinga
8ab9dc8b2b Fixed crash if Joy-Cons are disabled while a combined Joy-Cons controller is open 2022-08-03 13:18:00 -07:00
Sam Lantinga
bcdef4aaf9 Added separate hints for Nintendo Online classic controllers and Joy-Cons
This allows them to be enabled/disabled separately from Switch Pro HIDAPI support
2022-08-03 13:07:47 -07:00
Mathieu Eyraud
59a104b803 Do not pass NULL to memcpy
ReadJoyConControllerType calls WriteSubcommandSync with pbuf=NULL
2022-08-02 06:38:51 -07:00
Mathieu Eyraud
42b2320756 Fix memory leak of children for combined JoyCon 2022-08-02 06:33:18 -07:00
Sam Lantinga
12aa4d5653 Added header needed for SDL_Delay() 2022-08-01 11:11:25 -07:00
Sam Lantinga
aeb275149a Poll DirectInput devices to get their initial state
Fixes https://github.com/libsdl-org/SDL/issues/3816
2022-08-01 10:39:56 -07:00
Sam Lantinga
13e0c40ec2 Added mapping for the 8BitDo Pro 2 controller in DirectInput mode over Bluetooth on Linux 2022-07-29 17:28:36 -07:00
Sam Lantinga
62c831661c Added mapping for the 8BitDo Pro 2 controller in DirectInput mode 2022-07-29 17:14:55 -07:00
Sam Lantinga
41c363f7d6 Note that the PDP Versus Fighting Pad is an arcade fighting pad 2022-07-29 16:29:25 -07:00
Sam Lantinga
f3c1194c0f Removed obsolete comment 2022-07-28 21:50:41 -07:00
Sam Lantinga
aee179e46f Removed debug output 2022-07-28 21:50:20 -07:00
Sam Lantinga
d8fd78736b Added entry for the Nintendo Switch Joy-Con controller pair 2022-07-28 21:44:23 -07:00