Commit Graph

647 Commits

Author SHA1 Message Date
Sam Lantinga
b6238c87e4 Don't try to build the RAWINPUT driver if HIDAPI is disabled 2020-11-11 14:48:23 -08:00
Sam Lantinga
d1e10c313e Removed debug output 2020-11-11 14:38:14 -08:00
Sam Lantinga
e12457d8bf Added support for the Xbox Series X controller to the HIDAPI driver 2020-11-10 12:26:30 -08:00
Sam Lantinga
c3dea23120 Added support for reading the paddles on a Xbox Elite Series 2 controller in Bluetooth mode 2020-11-09 22:39:33 -08:00
Sam Lantinga
fb4a406af2 Don't put 'm' in the GUID for Xbox and PS4 controllers on iOS 2020-11-09 18:45:22 -08:00
Sam Lantinga
f8b8bd0ba1 ControllerList: recategorize controller as swtich pro and not switch input-only controller 2020-11-09 10:12:02 -08:00
Sam Lantinga
f76ca05729 ControllerList: add unknown xbox controller from minidumps 2020-11-09 10:11:59 -08:00
Sam Lantinga
1577366c36 Fixed duplicated switch statement processing Xbox controller dpad state 2020-11-08 23:49:03 -08:00
Bart van der Werf
3d92e8c742 hidapi: Also parse data[12] with dpad values on the xb1s controller 2020-10-21 10:43:46 -04:00
Sam Lantinga
4ea1a10bd2 Added stub controller LED functions for WGI and RAWINPUT (thanks meyraud!) 2020-11-07 02:49:22 -08:00
Sam Lantinga
009b62f1c2 Be explicit about mapping the new game controller paddle buttons 2020-11-07 02:22:15 -08:00
Sam Lantinga
749062e72b Implemented SDL_GameControllerSetLED() for iOS/tvOS 2020-11-06 16:53:13 -08:00
Sam Lantinga
faeac6e86c Added additional game controller button support on iOS/tvOS 2020-11-06 16:42:46 -08:00
Sam Lantinga
3a3aaac221 Added 4 auxiliary buttons to the game controller API
Xbox Elite controllers use AUX1-AUX4 to represent the paddle buttons when using the HIDAPI driver
PS4 and PS5 controllers use AUX1 to represent the touchpad button
Nintendo Switch Pro controllers use AUX1 to represent the capture button
2020-11-06 11:30:52 -08:00
Sam Lantinga
a22beef402 Moved the PS5 controller driver to a separate file, as the advanced feature protocol is very different from that of the PS4 2020-11-05 17:03:28 -08:00
Sam Lantinga
bd2dd3f6bb Added Android mapping for the Sony PS5 Controller 2020-11-05 15:36:15 -08:00
Sam Lantinga
4d79f9662f Added initial support for the Sony PS5 Controller 2020-11-05 15:02:54 -08:00
Sam Lantinga
e555d45331 Added SDL_JoystickHasLED
Currently, this is only supported by the PS4 HIDAPI driver.
2020-11-05 11:07:54 -08:00
Ethan Lee
83cddd2ebc Add SDL_JoystickSetLED.
Currently, this is only supported by the PS4 HIDAPI driver.
2020-04-30 11:57:29 -04:00
Sam Lantinga
ddc0727bba Fixed implicit memcpy() when building for ARM64 on Windows (thanks Seigo!) 2020-10-27 09:00:42 -07:00
Sam Lantinga
99ed0d7ab9 Map the guide button by default on Android 11 2020-10-16 12:40:12 -07:00
Sam Lantinga
3755f6920f Added mapping for Xbox One S controller and PS4 controller on Android 11, including guide button 2020-10-16 12:40:10 -07:00
Sam Lantinga
d9aea0c3a0 Update the existing haptic player when we rumble on iOS 2020-10-15 10:13:42 -07:00
Sam Lantinga
a558409b2e Only include CoreHaptics if we're building with rumble support 2020-10-13 21:08:18 -07:00
Sam Lantinga
75d5be974c Fixed compiling with an older iOS SDK 2020-10-13 21:08:17 -07:00
Sam Lantinga
6b62494ee4 Added support for controller battery status on iOS 14 2020-10-13 21:08:15 -07:00
Sam Lantinga
1b31e9f6dc Added support for game controller rumble on iOS 14 2020-10-13 21:08:13 -07:00
Sam Lantinga
2d7b33cb41 Added support for the controller home button on iOS 14 2020-10-13 21:08:11 -07:00
Sam Lantinga
45c644cc99 Added support for the MOGA XP5-X Plus 2020-09-28 21:19:45 -07:00
Kai Krakow
c3ecf18cc4 Linux: Add hint for disabling deadzones 2020-07-21 23:38:42 +02:00
Sam Lantinga
cab1a715f5 Fixed bug 5233 - PS3 Gamepad Motion Control not correctly ignored on Linux
Igor Morgado

PS3 Controller motion sensor string is being reported as

`Gasia Co.,Ltd PS(R) Gamepad Motion Sensors`

But `src/joystick/SDL_gamecontroller.c` line1690 only ignores if matches the string  `Controller Motion Sensors`.

```
#if defined(__LINUX__)
    if (name && SDL_strstr(name, "Controller Motion Sensors")) {
        /* Don't treat the PS3 and PS4 motion controls as a separate game controller */
        return SDL_TRUE;
    }
#endif
```

Therefore, SDL is mapping 2 Game controllers instead one.

Maybe reduce the substring to match `Motion Sensors` instead.


A simple log from my application is shown below:

INFO: Game controller device 0 - PS3 Controller:PS3 Controller found.
INFO: Controller 0: Player 0: 054c:0268:8111 - PS3 Controller - PS3 Controller - Gasia Co.,Ltd PS(R) Gamepad
INFO: Game controller device 1 - PS3 Controller:PS3 Controller found.
INFO: Controller 1: Player 1: 054c:0268:8111 - PS3 Controller - PS3 Controller - Gasia Co.,Ltd PS(R) Gamepad Motion Sensors
2020-07-15 10:15:52 -07:00
stfx
b162629546 cmake: Fix building with -DSDL_HAPTIC=Off 2020-07-08 17:28:34 +02:00
Ryan C. Gordon
0e98040d43 joystick: Linux joysticks now recover better from dropped events.
Fixes Bugzilla #4830.
2020-06-28 16:23:05 -04:00
stfx
efe0935904 Fix compile without DIRECTX 2020-06-15 10:31:16 +02:00
Sam Lantinga
aefe19ff08 Added support for the NACON Revolution Pro Controller 3 and the GameStop PS4 Fun Controller 2020-06-09 11:31:39 -07:00
Sam Lantinga
6f241bd520 Fixed build 2020-06-09 10:47:29 -07:00
Sam Lantinga
086be21e7a ControllerList: add support for NACON asymetric controller and Revolution 3, Hori mini wireless ps4 controller, and 2 PDP switch controllers 2020-06-09 10:47:27 -07:00
Sam Lantinga
3b76109f64 ControllerList: remove giotek controller from list - vid/pid appears to be reused in bunch of devies including ones with different fw/protocol and treating as ps4 controller breaks them. 2020-06-09 10:47:25 -07:00
Sam Lantinga
a9cfac3835 Controller: Deadzone improvements 2020-06-09 10:47:23 -07:00
Sam Lantinga
9fa8d6d0be Define constants not available on older kernels 2020-06-08 17:07:55 -07:00
Sam Lantinga
eea0b0e088 Fixed bug 5168 - Memory leak in RAWINPUT_JoystickOpen
meyraud705

Variable 'hwdata' is not freed in RAWINPUT_JoystickOpen if device->driver->OpenJoystick() fails.
2020-06-02 17:08:31 -07:00
Cameron Gutman
134362e745 Enable Xbox One HIDAPI driver on macOS
The Xbox One HIDAPI driver is required on macOS for Xbox One S Bluetooth
support since https://hg.libsdl.org/SDL/rev/10c3a10908e9
2020-04-25 19:15:51 -07:00
Sam Lantinga
ac1f174ad5 Fixed bug 5167 - Memory leak in GuessXInputDevice
meyraud705

Variable 'devices' is not freed if function GuessXInputDevice, in SDL_xinputjoystick.c, return early.
2020-06-02 17:02:37 -07:00
Sam Lantinga
d000c1cd6d Fixed bug 5155 - HIDAPI_JoystickDisconnected incorrect array shift
Anthony Pesch

I was looking into my own input bug and noticed an issue in the HIDAPI code while looking over it. I don't have a controller that goes down this path to test and try to provoke the issue, but it looks pretty straight forward.

The memmove to shift the joystick id array on disconnect isn't scaling the size by sizeof(SDL_JoystickID), likely corrupting the ids on disconnect.
2020-05-29 21:22:11 -07:00
Sam Lantinga
ae9ff11bae The zero happens at a higher level now 2020-05-29 14:54:07 -07:00
Sam Lantinga
39c958bbaa Initialize the raw_map before getting controller mappings from the driver 2020-05-29 14:48:39 -07:00
Sam Lantinga
2db049473b Fixed variable names to be consistent across functions 2020-05-29 14:48:05 -07:00
Sam Lantinga
345b4d7e14 Fixed bug 5161 - Autodetect controller mappings based on the Linux Gamepad Specification
Jan Bujak

I wrote a new driver for my gamepad on Linux. I'd like SDL to support it out-of-box, as currently it just treats it as a generic joystick instead of a gamepad. From what I can see the only way to do that is to either 1) pick one of the already supported controllers' PID, VID and button layouts and have my driver send that (effectively lying that it's something else), or 2) submit a preconfigured, hardcoded mapping to SDL.

Both of those, in my opinion, are silly when we already have the Linux Gamepad Specification which standarizes this:

https://www.kernel.org/doc/html/v4.15/input/gamepad.html

Unfortunately SDL doesn't make use of it currently. So I've took it upon myself to add it; patch is in the attachments.

Basically what the patch does is that if SDL finds no built-it controller mappings for a given joystick it then asks the joystick backend to autodetect it, and that uses the relevant evdev bits to figure out which button/axis is which. (See the specs for more details.)

With this patch applied my own driver for my controller works out-of-box with SDL with no extra configuration and is correctly recognized as a gamepad; this is also going to be the case for any other driver which follows the Linux Gamepad Specification.
2020-05-29 13:37:21 -07:00
Brendan Shanks
032fa681a8 Add Logitech G29 to steering wheel list 2020-04-24 14:03:30 -07:00
Sam Lantinga
1a1f1704a2 Don't include the iOS joystick driver if joysticks are disabled 2020-05-27 10:35:43 -07:00