Commit graph

1572 commits

Author SHA1 Message Date
Sam Lantinga 68e2f23066 Sorted controller list 2023-02-10 17:18:02 -08:00
Alfredo Escobar 76552e4780 Add Hori Pokken Tournament DX Pro Pad 2023-02-10 17:16:26 -08:00
Sam Lantinga e4face7c1d Fixed the share button on the ThrustMaster eSwap PRO Controller Xbox 2023-02-10 16:46:21 -08:00
Sylvain 7c4ec1867b Remove some vim config lines 2023-02-10 11:00:48 +01:00
Sam Lantinga e65e2c8ed7 SDL_CloseJoystick() should return void, not int 2023-02-09 17:26:16 -08:00
Linus Probert 3bd737d44c Add error returns to void functions that can fail/set errors.
This takes care of the last set of void functions that could
potentially be shifted to instead return an int indicating success and
setting an error in case of an error.
2023-02-09 07:23:21 -08:00
Sam Lantinga b7c6fec10a Make sure we synchronously re-enable USB reporting mode for Switch controllers (thanks @SortaCore!)
Fixes https://github.com/libsdl-org/SDL/issues/3450
2023-02-08 14:22:39 -08:00
Sam Lantinga 50575ed223 Note the Google Stadia controller doesn't support rumble over Bluetooth 2023-02-08 14:16:24 -08:00
Sam Lantinga 00e02de77b Fixed mis-detecting the share button on the Xbox controller over NDIS 2023-02-08 14:16:21 -08:00
Sam Lantinga d1c72bb0bc Dynamically update the serial number if it isn't available at first
This happens for Xbox One controllers using newer firmware connected over NDIS
2023-02-08 14:16:17 -08:00
Sylvain c5c94a6be6 Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
2023-02-07 13:51:45 -08:00
Sam Lantinga 5fded632d6 Added support for the Turtle Beach REACT-R and Recon Xbox controllers 2023-02-06 20:14:12 -08:00
Sam Lantinga 0208a0eeb3 Added support for the Logitech ChillStream 2023-02-06 13:28:59 -08:00
Sam Lantinga 22bafe8729 Removed debug code accidentally committed 2023-02-06 11:23:53 -08:00
Sam Lantinga f8b41919da Fixed warning running a command queue without any vertex operations 2023-02-06 11:22:00 -08:00
Leonardo Brondani Schenkel 6f06e4bc80 Add Linux mapping for 8BitDo Pro 2 Wired Controller for Xbox
Without these mappings, this controller "kinda" works out of the box:
- `SDL_GameControllerMapping()` works because it will notice "Xbox" in
  the name and use the default XInput mappings
- `SDL_GameControllerMappingForGUID()` will not find any mapping

lsusb:
```
ID 2dc8:2000 8BitDo 8BitDo Pro 2 Wired Controller for Xbox
```

In Linux this controller is supported by two drivers:
- `xpad` (built-in to the kernel), exposes the controller name from the
  USB descriptor and the GUID starts with 03 (0x03 = BUS_USB)
- `xone` (https://github.com/medusalix/xone), exposes a virtual
  controller which is always named "Microsoft X-Box One pad" and the
  GUID starts with 06 (0x06 = BUS_VIRTUAL)

This commit adds the 2 GUIDs from both drivers so mappings will always
be found and the real controller name will always be reported.

(cherry picked from commit 4266cf8504)
2023-02-05 08:45:24 -08:00
Sam Lantinga 1c03ddefc3 Sorted controller list 2023-02-05 08:43:26 -08:00
Antonis Geralis 52cd9fcbb0 Added Elecom 8button gamepad 2023-02-05 08:41:07 -08:00
Alynne 4dea13e02f Adds Stadia BT mapping 2023-02-03 15:01:49 -08:00
Sylvain Becker cb6b8b0132
Simplify flags testing (#7220) 2023-02-03 13:08:42 -08:00
Sam Lantinga 673bc57649 Don't accept official mappings for controllers that aren't unique
For example, the DragonRise Inc. Generic USB Joystick
See https://github.com/gabomdq/SDL_GameControllerDB/issues/202 for details
2023-02-02 08:39:54 -08:00
Sam Lantinga 917607c335 Fixed sort_controllers.py and resorted game controller database 2023-02-02 08:38:22 -08:00
Sam Lantinga d29e1f3632 Added gamepad mappings for the Xin-Mo Dual Arcade Fightstick 2023-02-01 23:09:53 -08:00
Sam Lantinga c5f570b30b Make sure count is 0 in out of memory conditions
This prevents a crash if the caller assumes that they can always dereference the returned pointer if there is a non-zero count.
2023-01-31 10:04:51 -08:00
Sam Lantinga a06a593aa6 Renamed SDL_GetGamepadNumTouchpads and SDL_GetGamepadNumTouchpadFingers to match the new convention 2023-01-24 13:47:30 -08:00
Sam Lantinga 7b50bae524 Renamed SDL events for clarity
Fixes https://github.com/libsdl-org/SDL/issues/6877
2023-01-24 07:26:48 -08:00
Sam Lantinga c4db0725e4 Enable paddles on the Xbox Elite controller when connected over USB 2023-01-20 09:31:22 -08:00
Sam Lantinga decbbb0499 Updated API for SDL_JoystickID sign change 2023-01-13 14:20:59 -08:00
happyharryh 57e78f4cf5 Fixed the hat_map to avoid segmentation fault 2023-01-12 06:55:35 -08:00
Ozkan Sezer 30516fd3a6 joystick/vita: add some sanity check to SDL_GetJoystickInstanceID result
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer f046788a5a joystick/vita: fix index value use returned by SDL_GetJoystickInstanceID
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer 0621a67350 fix SDL_GetJoystickInstanceID() return code upon failure
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Narr the Reg 9fa55d9cab hidapi: switch: Add user calibration support 2023-01-09 18:07:54 -08:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga c663e6d568 Revert "Always allow controller events for virtual joysticks regardless of focus state"
This reverts commit d94f2a9ee5.

Rather than changing behavior, we'll set SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS in the joystick tests
2023-01-09 09:05:40 -08:00
Sam Lantinga d94f2a9ee5 Always allow controller events for virtual joysticks regardless of focus state
Refrence https://github.com/libsdl-org/SDL/pull/7024
2023-01-08 10:48:46 -08:00
Sam Lantinga ac99db9fc8 Fixed infinite loop shutting down WGI controllers
We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list.

Fixes https://github.com/libsdl-org/SDL/issues/7016
2023-01-08 09:35:17 -08:00
Sam Lantinga 4f978456a8 Renamed SDL_GAMEPADDEVICEREMAPPED to SDL_GAMEPADREMAPPED 2023-01-04 14:32:37 -08:00
Sam Lantinga c823f26f18 Revert "Removed public joystick locking API"
This reverts commit a515f51ac0.

We still need joystick locking to protect the gamepad mappings
2023-01-04 13:51:40 -08:00
Sam Lantinga aaaf7423ac Fixed build 2023-01-03 16:17:10 -08:00
Sam Lantinga 32c077216c Fixed warnings 2023-01-03 15:59:35 -08:00
Sam Lantinga 49af0d1b89 Fixed build 2023-01-03 15:35:18 -08:00
Sam Lantinga e85839cd56 Fixed line wrapping for HID packet dump 2023-01-03 15:12:47 -08:00
Sam Lantinga dacdb1c310 Added support for the ThrustMaster eSwap PRO Controller Xbox 2023-01-03 15:12:18 -08:00
Mathieu Eyraud fa5475ba9f Fix joystick instance id check 2023-01-02 09:04:18 -08:00
Mathieu Eyraud ea6f0ae683 Fix use after free in SDL_GetGamepads 2023-01-02 09:03:49 -08:00
Sam Lantinga a515f51ac0 Removed public joystick locking API
All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()

Fixes https://github.com/libsdl-org/SDL/issues/6956
2022-12-31 09:24:14 -08:00
Sam Lantinga 324c0b76a0 Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
2022-12-29 23:20:26 -08:00
Sam Lantinga cefbeb582f Mouse coordinates are floating point
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.

Fixes https://github.com/libsdl-org/SDL/issues/2999
2022-12-29 23:12:19 -08:00
Sylvain Becker d7d3c22dbf
Remove more reserved identifiers (#6925) 2022-12-29 13:58:16 -08:00