1070 Commits

Author SHA1 Message Date
Cameron Gutman
677dc1015c rawinput: Fix double detection of gamepads on some 3rd party X360 wireless receivers
The name that the Raw Input joystick driver pulls from the HID stack comes
from USB string descriptors contained on the device. For official wireless
receivers, this always contains "Xbox 360 Wireless Receiver for Windows"
which matches the friendly name that WGI provides.

3rd party Xbox 360 wireless receivers may have different strings in their
USB string descriptors (one uses "XBOX 360 For Windows" instead). This
fails to match WGI's name and causes Raw Input and WGI to both report the
same gamepad.

Since wireless Xbox 360 controllers seem to have a consistent VID/PID
regardless of the adapter enumerating them, we can also match on that to
catch these.

The duplicate case reported to me was:
Controller (XBOX 360 For Windows) - 030000005e040000a102000000007200
Xbox 360 Wireless Receiver for Windows - 030000005e0400000000000000007701
2022-03-09 21:19:53 -08:00
Sam Lantinga
6a787619e6 Allow reading background events for MFi controllers 2022-03-08 18:42:13 -08:00
Sam Lantinga
1b7669374e Fixed the SDL controller type for USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER 2022-03-08 09:58:24 -08:00
Sam Lantinga
af40cb6f00 Added support for the Razer Huntsman Analog keyboard in controller mode 2022-02-23 15:49:10 -08:00
94d43186f2 GameCubeAdapter: Add suppport for all rumble modes
This adds support for all 3 of the gamecube controller's rumble modes
Rumble: 1
Stop: 0
StopHard: 2
This is useful for applications that need the full range of support
This also adds a hint to control rumble behavior, defaults 0 to maintain compatibility
2022-02-23 07:03:02 -08:00
Sam Lantinga
9299a3e796 Workaround for crash in CoUninitialize() 2022-02-21 16:24:45 -08:00
Sam Lantinga
18032979d8 Added the hint SDL_HINT_JOYSTICK_ROG_CHAKRAM to control whether ROG Chakram mice show up as joysticks
This hint defaults off, but when it is enabled the mice will have a game controller mapping set up for Profile 3 (set in the Armoury Crate software)
2022-02-15 13:07:51 -08:00
Sam Lantinga
f97a29f6e1 Use the real device VID/PID when seeing the Steam virtual controller 2022-02-11 22:10:33 -08:00
Ozkan Sezer
7935cfacc5 SDL_mfijoystick.m: use __typeof instead of typeof.
Fixes https://github.com/libsdl-org/SDL/issues/5319
2022-02-08 18:55:10 +03:00
Joshua Ashton
86b7a0642f Add additional VID/PIDs for Anne Pro II
This thing changes its VID/PID on firmware revisions...
2022-02-04 08:45:19 -08:00
Sam Lantinga
dd69c28d6f Added a mapping for the Xbox Series X controller, firmware version 5.11.3118.0, connected to Linux via Bluetooth 2022-02-03 18:01:34 -08:00
Temdog007
b59e75c259 Handle menu button press from controller 2022-02-02 21:21:44 -08:00
Ryan C. Gordon
43f0271b4e Revert "fix compiler warnings in SDL_windows_gaming_input.c"
This reverts commit ca36cdb185f2f26241598068927821896f36b904.

The older Windows SDK's headers are wrong, and this change would crash if
you hotplug a device.
2022-01-28 20:40:19 -05:00
pionere
60deadba59 re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory 2022-01-28 20:40:19 -05:00
pionere
d7110b4490 fix compiler warnings in SDL_windows_gaming_input.c 2022-01-28 20:40:19 -05:00
Vitaliy Zhmurikov
5b74459255 Update SDL_joystick.c
Add Logitech Momo Racing Wheel VID & PID  to SDL_IsJoystickProductWheel function
2022-01-27 12:30:41 -08:00
Ivan Epifanov
d7e0c54dde PSVita: send initial SDL_JOYDEVICEADDED events 2022-01-27 08:47:53 -08:00
Sam Lantinga
67cb548bef Fixed build error with C90 compilers 2022-01-20 19:31:54 -08:00
Carl Glave
a23b3c767f Add support for correlating trigger input 2022-01-20 17:43:35 -08:00
Sam Lantinga
b06866ef97 Entirely remove Xbox axis filtering, we don't want this at all. 2022-01-16 09:44:28 -08:00
Sam Lantinga
09aed1020b Don't send output reports to the Victrix Pro FS v2
It'll hang on reboot if it gets output reports, and it doesn't have functionality that requires them, so skip it.
2022-01-16 09:23:58 -08:00
Sam Lantinga
85961b61a1 Disable Xbox axis deadzone handling by default
Fixes https://github.com/libsdl-org/SDL/issues/5227
2022-01-16 09:01:56 -08:00
Sam Lantinga
1a50334c46 Fixed Xbox One trigger axis zero point 2022-01-14 15:04:26 -08:00
Ozkan Sezer
b9d98331c5 os2joystick: fix uninitialized use of local var 'maxdevs' 2022-01-09 20:33:32 +03:00
Ozkan Sezer
17da60068d os2joystick: fix -Wsequence-point issues. 2022-01-09 20:33:32 +03:00
Sam Lantinga
16f5b9e3c3 Filter jitter on Xbox One controllers when using raw input reports 2022-01-05 11:07:52 -08:00
Cameron Gutman
419ae29d90 joystick: Move WGI driver initialization after Windows driver
WGI calls SDL_DINPUT_JoystickPresent() so we need to be sure DInput remains
initialized for the lifetime of the WGI driver to avoid a crash or duplicated
joysticks between DInput and WGI.
2022-01-04 15:53:39 -08:00
Cameron Gutman
d73bd0d2f6 dinput: Don't crash in SDL_DINPUT_JoystickPresent if DInput init failed
The WGI driver will call this regardless of whether our init succeeded.
2022-01-04 15:53:39 -08:00
Sam Lantinga
120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Ozkan Sezer
82fc67ae4d SDL_joystick.c: cast the arguments to nibble() to unsigned char. 2021-12-18 14:01:02 +03:00
Ozkan Sezer
47d3e96b43 SDL_joystick.c: (unsigned char) cast to SDL_tolower() parameters. 2021-12-18 14:01:02 +03:00
Ozkan Sezer
61107494a1 SDL_gamecontroller.c: (unsigned char) cast to SDL_isdigit() parameters. 2021-12-17 07:40:02 +03:00
Sergio Padrino
6f6382f8d0 Fix SDL_GameController API for PSP (#3)
- Add missing mapping
- Make sure the only window has the keyboard focus (so no `SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS` is needed)
2021-12-07 09:04:05 -08:00
Ozkan Sezer
f266d92286 psp/SDL_sysjoystick.c: fix -Wshadow warnings. 2021-12-07 14:04:32 +03:00
Sam Lantinga
a4c04ad230 Fixed building with iOS SDK prior to 13.0
Fixes https://github.com/libsdl-org/SDL/pull/5045
2021-11-30 10:32:39 -08:00
Sam Lantinga
b6bc3a6b0e Added a mapping for the PS4 touchpad button on Windows
Fixes https://github.com/libsdl-org/SDL/issues/5035
2021-11-29 09:00:54 -08:00
Sam Lantinga
dd2f91118e Fixed warnings with Windows SDK 10.0.19041
Fixes https://github.com/libsdl-org/SDL/issues/4998
Also breaks https://github.com/libsdl-org/SDL/issues/4998 for older SDKs, but we're going to ignore them, they're just incorrect.
2021-11-27 20:18:29 -08:00
Sam Lantinga
c2904c8ce7 Fixed compile warnings and errors
Fixes https://github.com/libsdl-org/SDL/issues/4998
2021-11-27 11:16:15 -08:00
Sam Lantinga
a6cbe0ab87 Controllers are always centered at zero using XInput and WGI 2021-11-27 10:58:12 -08:00
Sam Lantinga
09b7ca27d6 Get the current WGI controller list at startup
On Win32 this list is empty and we always get controller added events. On UWP, this list is populated and we don't get controlle added events for currently connected controllers.
2021-11-27 10:53:20 -08:00
Sam Lantinga
12895eca1a Fixed WGI initialization on Win32 2021-11-27 10:52:58 -08:00
Sam Lantinga
110e4e1334 Use WGI instead of XInput for Windows 10 UWP apps
Fixes https://github.com/libsdl-org/SDL/issues/5017
2021-11-27 10:24:32 -08:00
Mathieu Eyraud
02021ae753 Return capabitlities from RawInput joystick 2021-11-27 07:26:10 -05:00
Sam Lantinga
a2e8565230 The Google Pixel fingerprint sensor isn't actually a joystick
Fixes https://github.com/libsdl-org/SDL/issues/4971
2021-11-26 11:04:15 -08:00
Sam Lantinga
67b5de5b41 Fixed build warnings 2021-11-26 10:18:08 -08:00
Sam Lantinga
2ca2ad76da Fixed build warnings 2021-11-26 10:13:45 -08:00
Sam Lantinga
f90164a62f Fixed mapping for the G-Shark GS-GP702
Fixes https://github.com/libsdl-org/SDL/issues/5006
2021-11-26 09:02:12 -08:00
Sam Lantinga
d861820465 SDL_JoystickGetAttached() doesn't need to be noisy for NULL joystick
Fixes https://github.com/libsdl-org/SDL/issues/5008
2021-11-26 07:57:48 -08:00
Cameron Gutman
b99510836e SDL_mfijoystick.m: Fix -Wshadow warning 2021-11-24 13:04:50 -06:00
Ozkan Sezer
f8900583e5 removed windows winmm joystick driver 2021-11-23 17:04:40 +03:00