Sam Lantinga
1af31a26d1
Fixed trying to handle the HORI Wireless Switch Pad when connected via USB
2020-02-27 13:53:32 -08:00
Sam Lantinga
20d67446e0
Xbox One controller rumble doesn't need synchronization if you use a packet counter of 0
2020-02-27 09:33:32 -08:00
Sam Lantinga
8d14636326
Fixed support for third party Xbox 360 wireless controller dongle
2020-02-19 08:26:00 -08:00
Sam Lantinga
ad225047b6
Added Android SDK conditionals to game controller mappings
...
The Nintendo Switch Pro controller has a different mapping on Android 10 and newer
2020-02-17 14:15:47 -08:00
Sam Lantinga
715f8d42a2
Fixed bug 4986 - Memory leak in HIDAPI_JoystickConnected
...
meyraud705
Memory allocated for device->joysticks on line 589 of SDL_hidapijoystick.c is never freed.
Also, use memmove because memory is overlapping.
2020-02-14 16:15:46 -08:00
Sam Lantinga
e5e5416975
Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID.
...
Specifically the Razer DeathAdder 2013 has this VID/PID
2020-02-07 20:19:32 -08:00
Sam Lantinga
833f76ab7b
Fixed bug 4968 - NULL passed to memcpy in WriteProprietary in SDL_hidapi_switch.c
...
meyraud705
In SDL_hidapi_switch.c
line 443: Function BTrySetupUSB call WriteProprietary with pBuf=NULL and ucLen=0
line 376: WriteProprietary check its input (!pBuf && ucLen > 0) || ucLen > sizeof(packet.rgucProprietaryData): ucLen is 0 so it passes
line 382: WriteProprietary call memcpy with pBuf=NULL
2020-02-07 11:49:56 -08:00
Sam Lantinga
8ba77b35a5
Use the asynchronous HIDAPI rumble code for Nintendo Switch Pro controllers
2020-02-07 11:44:57 -08:00
Sam Lantinga
81256207bd
Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms
...
meyraud705
Dualshock4 on bluetooth need 78 bytes for the rumble data while SDL_HIDAPI_RumbleRequest can only hold 64 bytes.
'volatile' is not meant for thread synchronization.
The list of rumble request could grow infinitely if user call SDL_JoystickRumble too much. The documentation says "Each call to this function cancels any previous rumble effect", so overwriting pending request seem like a good idea.
2020-02-07 11:02:34 -08:00
David Ludwig
d88f3f5226
macOS: fix crash if and when joystick-init-on-add fails
2020-02-05 13:16:17 -05:00
Sam Lantinga
a199cb89ad
Updated the Android Xbox One Wireless Controller mapping for the latest Xbox controller firmware update
2020-02-05 09:29:46 -08:00
Sam Lantinga
dc1d3c2974
Catch both PS3 and PS4 motion controls and don't treat them as a game controller
2020-02-04 18:36:23 -08:00
Sam Lantinga
1d1a35ef64
Fixed Visual Studio build
2020-02-04 16:05:39 -08:00
Sam Lantinga
1bd120266f
Added SDL_hidapi_rumble.c to the macOS, iOS and tvOS builds
2020-02-04 15:42:49 -08:00
David Ludwig
65fd633694
FIX for SDL-4927: CFRetain+CFRelease a game controller's IOKit object
...
This fixes a crash whereby SDL could crash on macOS/Darwin, if and when a
USB game controller gets unplugged. SDL was not retaining a reference
to the controller's OS/IOKit-provided 'device object', and was capable
of trying to use it, after a device was hot-unplugged.
2020-01-30 18:03:34 -05:00
Sam Lantinga
02108cf7e5
Added missing files from previous commit
2020-02-04 15:27:25 -08:00
Sam Lantinga
1684606fdf
Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers
...
There is now a thread that handles all HIDAPI rumble requests and a lock that guarantees that we're not reading and writing the device at the same time.
2020-02-04 15:26:56 -08:00
Sam Lantinga
6efebf1768
Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests.
2020-02-04 12:48:53 -08:00
Sjoerd Simons
976eee77cc
Correct joystick hat indexes on linux
...
The index and indices were swapped; Which is fine as long as there are
no gaps in the ABS_HAT* event availability but otherwise things do get confused.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2020-02-04 07:23:44 -08:00
Sam Lantinga
212609b3f2
Map the right pad on the Steam Controller to the right stick in the game controller API
2020-01-31 14:09:23 -08:00
Sam Lantinga
39a498c940
Build the hidapi framework and weak link it on Mac OS X
2020-01-31 13:09:20 -08:00
Sam Lantinga
91121ee4bb
Weak link the hidapi framework on iOS and tvOS
2020-01-31 10:45:04 -08:00
Sam Lantinga
0641711e9f
Added missing file from previous commit
2020-01-29 20:09:59 -08:00
Sam Lantinga
355f0b54ec
Added support for the Steam Controller on mobile devices
2020-01-29 20:09:11 -08:00
Sam Lantinga
c9c89783cb
Miscellaneous pending fixes
2020-01-29 20:09:08 -08:00
Sam Lantinga
43b377b077
Fixed wired PS4 controller support on Android
2020-01-28 17:11:17 -08:00
Ryan C. Gordon
059de38c2c
darwin: Don't pass NULL device refs to IOHIDDeviceGetValue().
...
Possibly fixes Bugzilla #4961 .
2020-01-27 15:44:48 -05:00
Sam Lantinga
7ea3f5b464
Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble
...
meyraud705
Switch hidapi and xinput also need to check for overflow, attached a patch for them.
2020-01-26 12:48:35 -08:00
Sam Lantinga
adb53d0b1f
Fixed disabling the Xbox 360 wireless HIDAPI driver
2020-01-26 10:32:39 -08:00
Sam Lantinga
c9f672fde4
Fixed compiler warnings
2020-01-23 22:24:24 -08:00
Sam Lantinga
2ae41b9c61
Fixed mapping for both versions of the Xbox One Elite Series 2 controller firmware connecting over Bluetooth
2020-01-23 12:53:43 -08:00
Sam Lantinga
48240ac88e
Added mapping for the Xbox One controller connected via the wireless dongle using xow
2020-01-23 12:53:41 -08:00
Sam Lantinga
6dc172d093
Turn off rumble on drivers which don't respect the replay.length value
2020-01-23 12:53:39 -08:00
Sam Lantinga
443bce741b
Added support for the paddles on the Xbox One Elite Series 1 controller
2020-01-22 11:28:35 -08:00
Sam Lantinga
25c88ea903
The Xbox One 0x01 initialization packet is an ack packet
2020-01-20 13:53:40 -08:00
Sam Lantinga
9c3d1602ab
Refactored code so SDL_GetJoystickGameControllerType() is called less during controller detection
2020-01-19 11:43:36 -08:00
Sam Lantinga
ff06801106
Added missing file from previous commit
2020-01-18 11:21:42 -08:00
Sam Lantinga
43aa1fa9e7
Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android
2020-01-18 11:21:14 -08:00
Sam Lantinga
27035425e0
There are multiple bindings for XBox One controller model 1708, depending on firmware revision
2020-01-17 11:09:57 -08:00
Sam Lantinga
bde1a371d1
Added support for the NACON GC-400ES
2020-01-17 11:07:19 -08:00
Sam Lantinga
4e682461cc
Reattach the kernel driver after closing USB controllers
2020-01-17 10:43:14 -08:00
Sam Lantinga
a8780c6a28
Updated copyright date for 2020
2020-01-16 20:49:25 -08:00
Sam Lantinga
c6817a2c19
Added support for the paddles on the Xbox One Elite Series 2 controller
2020-01-16 15:32:41 -08:00
Sam Lantinga
4e1cc124d2
Improved Xbox One controller initialization
2020-01-16 15:32:39 -08:00
Sam Lantinga
669729a8a0
Improved Xbox One controller initialization sequence
...
This sequence works across Microsoft, PowerA, PDP, and HORI controllers.
The newer Microsoft XBox firmware requires synchronizing the rumble sequence number, when SDL sees it after the initial connect
The Razer Wildcat controller requires waiting for init responses before continuing the initialization sequence.
The PDP Battlefield 1 controller takes over a second to be ready for initialization, and if initialization is attempted before then, it will fail.
2020-01-15 22:18:31 -08:00
Sam Lantinga
3448600526
Added support for the HORI Fighting Commander
2020-01-15 22:18:29 -08:00
Sam Lantinga
6705e27c9f
Added D-PAD bindings for the Linux Steam Controller
2020-01-13 22:05:58 -08:00
Sam Lantinga
cb800d1c27
Fixed compiler warning
2020-01-13 22:05:56 -08:00
Sam Lantinga
7775f7cedf
Fixed deadlock in HIDAPI joystick system
2020-01-13 22:05:54 -08:00
Sam Lantinga
3a796d6a58
Free the joystick player index when the joystick is removed
2020-01-13 15:35:54 -08:00