Commit Graph

1465 Commits (d5572559a5016d8068706de4614496a19f8970d4)

Author SHA1 Message Date
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Sam Lantinga 3b318f981e Removed G29 from controller_type.c
We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit dce6ed56d72b436f15c044b05097ddebbc166701)
2022-11-22 10:57:45 -08:00
Sam Lantinga 189f71efb3 Revert "Added Linux mappings for the Logitech G29 in PS3 and PS4 modes"
This reverts commit 33a68f575f.

We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit e3d430b83eb7c754c789fb23184feb745c2b99a8)
2022-11-22 10:57:39 -08:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Sam Lantinga d167cd6715 Added the Gunfighter Mk.III ‘Space Combat Edition’ as a flight stick 2022-11-21 09:02:10 -08:00
Sam Lantinga 8b20b568b0 Don't report battery level for disconnected batteries
Fixes https://github.com/libsdl-org/SDL/issues/6536
2022-11-21 07:42:14 -08:00
Sam Lantinga 509939b1b6 Disable the third party PS3 HIDAPI driver by default, the L3/R3 buttons are unknown 2022-11-18 18:20:53 -08:00
Sylvain 60c6cd554d
Fixed bug #6533 - PS2_JoystickUpdate: some invalid condition 2022-11-17 09:34:27 +01:00
Ryan C. Gordon 389ffab733 Code style fixes, etc.
Reference PR #6345.
2022-11-16 12:53:48 -05:00
ulatekh ec58a817ef Fixes made in response to running a static code analyzer under MS Windows.
Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs.

SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision.
SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer.
SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used.
SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range.
SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it.
SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691).
SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen.
SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL.
SDL_pixels.c: Looks like the switch is genuinely missing a break!
SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons.
SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
2022-11-16 12:43:20 -05:00
Pierre Wendling bf4f9aaa63 N3DS: Use designated initialiser for drivers.
Just a sanity check that the functions are actually mapped correctly.
2022-11-14 21:24:10 -08:00
Sam Lantinga b7e65a81f1 Fixed incorrect WGI controller state when the application loses focus
Recenter the controller elements when WGI stops reporting valid state

Fixes https://github.com/libsdl-org/SDL/issues/5261
2022-11-11 08:58:27 -08:00
Sam Lantinga 0dfc829a6b Added simple BLE Steam Controller support on all platforms
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Sam Lantinga 7c05ea0a0e Added mappings for the GameSir T3 and T4 Pro controllers 2022-11-10 13:35:59 -08:00
Sam Lantinga 404cb27677 Added macOS mappings for the Nintendo Switch Pro Controller over Bluetooth 2022-11-10 13:28:03 -08:00
meyraud705 3dc88da022 Fix Dualshock 4 rumble stopping too early
Dualshock 4 controller only rumbles for 5 seconds maximum. Resend
rumble command every 2 seconds to make long rumble work.
2022-11-08 10:30:11 -08:00
Sam Lantinga 6432f45a1c Don't treat the Nintendo IMU as a separate game controller on Linux 2022-11-08 10:27:21 -08:00
Sam Lantinga 2e3b4f3fd7 Don't send rumble to the Amazon Luna controller on macOS
Sending rumble to the Amazon Luna controller on macOS gets there, but IOHIDDeviceSetReport() blocks for a long time and eventually fails.

This appears to be a bug in the macOS Bluetooth stack, ref rdar://99265496
2022-11-08 07:50:51 -08:00
Sam Lantinga 02bc359b64 Shorten "Bensussen Deutsch & Associates,Inc.(BDA)" to "BDA" for controller names 2022-11-07 19:31:18 -08:00
Sam Lantinga f2ce7c5fb2 Added the G29 as a PlayStation controller 2022-11-06 08:23:08 -08:00
Sam Lantinga 9d1dbd2ad8 Added note about trigger rumble availability across third-party Xbox One controllers 2022-11-06 01:16:52 -08:00
Sam Lantinga e7a56323ab Make sure we wait after sending the rumble packet when initializing the PowerA Xbox One Mini Wired Controller 2022-11-06 01:43:05 -07:00
Sam Lantinga 6875e62af3 Make sure we don't send Xbox controllers rumble so quickly that it overwhelms the firmware
Fixes https://github.com/libsdl-org/SDL/issues/6435
2022-11-06 01:15:20 -07:00
Sam Lantinga 38af459dd9 Fixed potential clobbering of packets of different types using SDL_HIDAPI_SendRumble() 2022-11-06 01:15:19 -07:00
Sam Lantinga e45cb5b1e2 Fixed initializing the PowerA Xbox One Mini Wired Controller 2022-11-06 01:15:18 -07:00
Sam Lantinga a4626dea8d Fixed initializing the PDP Xbox One and Victrix Gambit controllers 2022-11-05 14:24:41 -07:00
Sam Lantinga 7e11b09b3b The PowerA Xbox One Mini Wired Controller works with the HIDAPI driver now 2022-11-05 13:50:37 -07:00
Sam Lantinga a2d66b6a91 SDL_GameControllerMapping() should return the string for the actual mapping that was used when opening a gamecontroller, rather than do a GUID match again
Also don't match against the zero guid if that happens to be in the mapping list for some reason
2022-11-05 13:12:10 -07:00
Stefan Sperling f3bf543e2a recognize game controllers connected via raphnet technologies WUSBMote v2.2
This is a USB adapter for controllers shipped with Nintendo's NES-mini and
SNES-mini consoles.
Tested with both NES and SNES controllers, buttons map as expected on both.
2022-11-05 10:35:07 -07:00
Sam Lantinga 24cdebe464 Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the Xbox button LED on the Xbox One controller 2022-11-05 10:34:08 -07:00
Sam Lantinga 33a68f575f Added Linux mappings for the Logitech G29 in PS3 and PS4 modes 2022-11-03 16:02:58 -07:00
Sam Lantinga c70e675900 Wait a bit for devices to initialize before trying to enumerate and open them.
This works around udev event nodes arriving before hidraw nodes and the controller being opened twice - once using the Linux driver and once by the HIDAPI driver.

This also fixes a kernel panic on Steam Link hardware due to trying to open the hidraw device node too early.

A delay of 10 ms seems to be a good value, tested on Steam Link hardware.
2022-11-03 12:37:54 -07:00
Sam Lantinga b75d318776 Sometimes the HID open doesn't succeed immediately after being notified about the device
Tested on Steam Link hardware with the Nintendo Switch Pro controller, which will occasionally take 2 attempts to open.
2022-10-31 13:33:53 -07:00
Sam Lantinga 25d0473aad Removed Razer Onza Tournament Edition mapping
The controller can use either hat or buttons for the D-Pad, depending on what Linux driver is in use. The automatic mapping in LINUX_JoystickGetGamepadMapping() will do the right thing based on the exposed capability bits.

I'm sure this is the case for other controllers as well, so we might be removing more mappings over time.
2022-10-25 16:14:26 -07:00
Sam Lantinga e837debc25 Bindings should have a trailing comma, so the CRC can be appended 2022-10-25 16:13:50 -07:00
Sam Lantinga c74ea994a5 Added support for the Razer Raiju Tournament Edition controller in Bluetooth mode 2022-10-25 13:11:41 -07:00
Sam Lantinga 72f6e216dc Disabled debug logging 2022-10-25 12:25:57 -07:00
Alynne 5fbf8f6cf0 Adds DualSense Edge 2022-10-25 10:32:44 -07:00
Sam Lantinga da478d1f66 Fixed build 2022-10-25 10:30:56 -07:00
Sam Lantinga a6018ae57f Added support for the NVIDIA SHIELD controller v1.03 to the HIDAPI driver 2022-10-25 10:23:51 -07:00
Steven Noonan 3d35c08585 fix a few 'unused but set variable' and 'unused function' warnings 2022-10-24 10:36:56 -07:00
Sam Lantinga f4d1f5ed54 SDL-HIDPS4: fix PS4 Slim controller over BT - it sends the same input report as the it does over USB, but with a larger packet size
CR: saml
2022-10-23 16:35:36 -07:00
Sam Lantinga 5b8f830e34 Virtual joysticks don't need initial axis jitter protection
Fixes https://github.com/libsdl-org/SDL/issues/6426
2022-10-22 09:25:09 -07:00
Sam Lantinga 0bc852ce53 Revert "Disable the RAWINPUT joystick driver by default"
Disabling RAWINPUT on Windows 10 causes these issues:
* All Xbox controllers are named "XInput Controller".
* Trigger rumble no longer works.
* "XInput Controllers" are now also listed as separate haptic devices
2022-10-17 17:43:06 -07:00
Sam Lantinga 333935ff3f Make sure we completely unlock joysticks when opening HIDAPI devices
Also lock the joysticks when adding and removing Android joysticks
2022-10-17 11:10:53 -07:00
Sam Lantinga 47ba997f06 Disable the RAWINPUT joystick driver by default
It's only needed to support more than 4 Xbox controllers, and adds significant complexity to the joystick processing, and we regularly get bugs from people who aren't using an SDL window who need to turn on SDL_HINT_JOYSTICK_THREAD.
2022-10-17 07:39:52 -07:00
Sam Lantinga 5025f24033 Don't use RAWINPUT joystick driver on Windows XP
Fixes https://github.com/libsdl-org/SDL/issues/6400
2022-10-17 07:35:00 -07:00
Sam Lantinga 70dfd6dd1a Added mapping for Xbox Series X controller
Fixes https://github.com/libsdl-org/SDL/issues/6296
2022-10-16 09:06:02 -07:00
Sam Lantinga e8fdb861ef Removed redundant masking when loading the IMU calibration 2022-10-15 10:02:39 -07:00
happyharryh a6573f94ab Fix bugs in IMU calibration loading for Nintendo Controllers 2022-10-15 10:01:22 -07:00