Sam Lantinga
828a0a4a10
Fixed mapping for PS4 controller when using the classic Joystick
...
interface on Linux
2021-11-11 07:13:29 -08:00
Sam Lantinga
dc9de1e2bd
Get the correct USB VID/PID information for /dev/input/js* devices
2021-11-11 07:03:30 -08:00
Sam Lantinga
bd92a95f22
Cleanup for the /dev/js* support (thanks @meyraud705)
2021-11-11 06:30:36 -08:00
Sam Lantinga
1c78b08007
Added support for /dev/input/js* on Linux
...
Added the hint SDL_HINT_LINUX_JOYSTICK_CLASSIC to control whether /dev/input/js* or /dev/input/event* are used as joystick devices
Added the hint SDL_HINT_JOYSTICK_DEVICE to allow the user to specify devices t
hat will be opened in addition to the normal joystick detection
Fixes https://github.com/libsdl-org/SDL/issues/1314
Fixes https://github.com/libsdl-org/SDL/issues/1727
Fixes https://github.com/libsdl-org/SDL/issues/1981
Closes https://github.com/libsdl-org/SDL/pull/4727
2021-11-10 20:02:25 -08:00
Sam Lantinga
65a50b2430
Re-enable udev joystick enumeration by default
2021-11-10 16:15:22 -08:00
Sam Lantinga
7681929cb4
Don't send the initial joystick axis event if the application is in the background
2021-11-09 12:30:37 -08:00
Sam Lantinga
d31f90d9e1
Don't send game controller touchpad or sensor events unless the application has focus
...
Fixes https://github.com/libsdl-org/SDL/issues/4891
2021-11-09 12:09:01 -08:00
Sam Lantinga
2a6feb5011
Removed accidental debugging commit (thanks @DomGries!)
2021-11-08 07:10:38 -08:00
Sam Lantinga
5b646cd19e
Build hidapi code into SDL as a new public API
...
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
2021-11-07 23:00:59 -08:00
Cameron Gutman
f6dc47caef
WGI/DInput: Fix SDL_IsXInputDevice() checks when RawInput is enabled
...
Enabling the RawInput backend causes SDL_XINPUT_Enabled() to return false.
That causes WGI and DInput backends to take ownership of XInput-compatible
controllers, because they think there's no XInput-specific backend enabled.
In WGI's case, it will actually race with RawInput to open the device. By
properly excluding XInput devices from WGI, we can ensure that the sets of
devices managed by WGI and RawInput don't intersect. This makes the race
harmless, since they'll never both go after the same device.
2021-11-07 16:14:33 -06:00
Sam Lantinga
301389cecc
Fixed iOS build
2021-11-07 13:53:12 -08:00
Cameron Gutman
b3e909dc41
WGI: Fix SDL_IsXInputDevice() for Xbox One controllers
...
The Xbox One driver stack doesn't propagate the VID/PID down to the
HID devices that end up in the GetRawInputDeviceList() output. This
means we end up matching against the wrong VID/PID and can't properly
exclude Xbox One controllers from WGI.
Fortunately, it is possible to walk back up the device tree to find
the parent with the matching VID/PID.
2021-11-07 13:33:18 -08:00
Sam Lantinga
b8c00bf914
Allow opening joysticks that are read-only on Linux
...
Fixes https://github.com/libsdl-org/SDL/issues/4713
2021-11-07 13:11:29 -08:00
Sam Lantinga
0323d983c6
Add the platform to the game controller mapping so it can be read back in without changes
...
Fixes https://github.com/libsdl-org/SDL/issues/4848
2021-11-07 12:52:48 -08:00
Sam Lantinga
fe2fe29049
Backed out accidentally committed PR https://github.com/libsdl-org/SDL/pull/4849
2021-11-07 11:48:16 -08:00
Sam Lantinga
86bc65a741
Fixed non-Apple builds
2021-11-07 11:35:12 -08:00
Sam Lantinga
637bcd0b72
Fixed build warnings
2021-11-07 11:19:07 -08:00
Sam Lantinga
e14358265e
Cleanup sfSymbolName support and add them to the dynamic API functions
2021-11-07 11:16:48 -08:00
Patrick Hogan
149e5c656a
Support returning sfSymbolsName for gamepad controls on macOS / iOS / tvOS
2021-11-07 10:58:37 -08:00
Cameron Gutman
6312aaea0f
WGI: Add workaround for delayed callbacks after WGI_JoystickQuit()
2021-11-06 21:35:01 -07:00
Cameron Gutman
2371b247ff
windows: improve feature detection consistency between CMake and non-CMake builds
2021-11-03 08:41:36 -07:00
Sam Lantinga
26706319d7
Ignore the ASRock LED controller, it's not a joystick
2021-10-30 05:53:12 -07:00
Tanuj Bagaria
1f0eb03a76
Fix PS5 mapping with HID-PLAYSTATION driver ( #4675 )
...
* add missing PS5 Linux GUID for Bluetooth
* Fix PS5 Mapping to work with HID-Playstation driver
2021-10-24 17:54:26 -05:00
Sam Lantinga
f3fd1ffb99
Fixed crash if SDL API functions are called on a disconnected controller on iOS
2021-10-20 15:18:03 -07:00
Sam Lantinga
a43d3f6931
Don't detect the ROG Chakram mouse as a joystick
2021-10-20 15:19:22 -07:00
Ozkan Sezer
8e9ea2e362
SDL_os2joystick.c: missed replacing a use of libc function
2021-10-18 14:10:37 +03:00
shaquan-omari
ea97ab6164
Add mapping for HORI Fighting Commander OCTA controller on Linux
2021-10-16 15:25:38 -07:00
Ozkan Sezer
e92a639b23
replaced many uses of libc calls with SDL_ counterparts in os2 sources.
...
TODO: core/os2 and geniconv sources _must_ be updated, as well..
2021-10-04 23:00:28 +03:00
Sam Lantinga
c501d159a9
Fixed range for Steam Controller sensor values
2021-10-03 14:10:21 -07:00
Sam Lantinga
ea1a2b94f2
Use the correct update rate for Steam Controller sensors
2021-10-02 09:13:29 -07:00
Sam Lantinga
8b74575267
Added support for the gyro and accelerometer on Steam Controllers
...
Fixes https://github.com/libsdl-org/SDL/issues/4577
2021-10-01 21:32:21 -07:00
Sam Lantinga
9706feacae
Update length after shortening string (thanks mayraud705!)
...
Closes https://github.com/libsdl-org/SDL/pull/4698
2021-10-01 15:11:25 -07:00
Cameron Cawley
08ae790497
Replace calls to asprintf with SDL_asprintf
2021-09-22 11:53:46 -07:00
Sam Lantinga
345c161feb
Fixed some accidental uses of external C runtime functions
2021-09-22 09:06:45 -07:00
Sam Lantinga
ff85d4fbe5
Fixed Xbox Series X controller being detected by both IOKit and GCController on macOS
2021-09-08 17:51:47 -07:00
Sam Lantinga
9f8552588d
Added mapping for Xbox One S controller with newer firmware on macOS
2021-09-08 17:50:17 -07:00
Sam Lantinga
bf97c5a22f
Make sure SDL file descriptors don't leak into child processes
2021-09-08 14:47:40 -07:00
Sam Lantinga
7ed7644a26
Fixed compiling HIDAPI Steam Controller support with C89 compiler
2021-09-07 17:37:47 -07:00
Sam Lantinga
27a48b142b
Check the pathname first, as that's a faster check for XInput devices
2021-09-07 15:50:21 -07:00
Sam Lantinga
503ea8e89f
Don't modify the Nintendo Switch home LED state by default
2021-08-25 14:42:16 -07:00
Sam Lantinga
130b6bebae
Manually scan for Linux joysticks before udev scan runs
...
This allows us to have joysticks sorted by insert time at startup, fixing https://github.com/libsdl-org/SDL/issues/4688
2021-08-24 17:03:19 -07:00
Sam Lantinga
cbccf5bb50
Use SDL_GetHint() instead of SDL_getenv() for Linux joystick hints
2021-08-24 17:03:19 -07:00
Shawn Ellis
0ae2a9f8c3
Fixed the Atari gamecontroller mappings and added Atari Xbox 360
...
This change corrects the mappings for the Atari gamecontroller and
adds support for the Atari Xbox 360 compatible gamecontroller. The Atari
game controller can switch between Atari and Xbox 360 mappings.
2021-08-24 13:06:27 -10:00
David Gow
fbc364908a
Use the new SDL_clamp() macro where sensible
...
There were a few places throughout the SDL code where values were
clamped using SDL_min() and SDL_max(). Now that we have an SDL_clamp()
macro, use this instead.
2021-08-14 09:01:14 -07:00
Sam Lantinga
dcc5eef0e2
Clarify that one of the PIDs of the Xbox Elite Series 2 controller is used in Bluetooth mode
2021-08-14 00:31:46 -07:00
Sam Lantinga
e42e9a12de
Fixed build
2021-08-13 20:48:56 -07:00
Sam Lantinga
441fbcaa3d
Added HIDAPI support for the Xbox Adaptive Controller
2021-08-13 20:48:54 -07:00
Sam Lantinga
907943a236
Added support for the Xbox One S Controller with 5.x series firmware
2021-08-12 17:51:08 -07:00
Ozkan Sezer
7aec0b90ee
SDL_hidapi_xboxone.c: fix bogus 'uninitialized' warning from clang.
...
The last 'size == 50' check is always true anyway.
2021-08-13 01:56:56 +03:00
Sam Lantinga
cec5a129f5
Fixed libudev hotplug notifications in the HIDAPI driver
2021-08-12 15:49:33 -07:00
Sam Lantinga
6eb4ebb502
Simplified the HIDAPI Xbox One controller initialization
2021-08-12 15:49:33 -07:00
Sam Lantinga
584b89abe6
Added support for the color LED on the Xbox Elite Series 2 controller
2021-08-12 08:17:10 -07:00
Sam Lantinga
64882b2466
Added support for the Xbox One Elite 2 Controller with 5.x series firmware
2021-08-12 08:17:08 -07:00
Andrei Alexeyev
e9179314c4
joystick/linux: fix memleaks; streamline joylist item removal
2021-08-11 14:11:52 -07:00
Sam Lantinga
de6ba40d9e
Added support for the Flydigi Vader 2 controller in 2.4G Android mode
2021-08-09 11:38:22 -07:00
Sam Lantinga
3f440daad9
Added support for the Flydigi Vader 2 controller in Bluetooth mode
2021-08-09 10:40:36 -07:00
Cameron Gutman
791d9d3ff6
Fixed DInput mapping for NVIDIA Virtual Gamepad
2021-08-07 14:20:43 -07:00
Ryan C. Gordon
dd683073bb
hidapi: Patched to compile on QNX.
...
Fixes #4591 .
2021-08-06 15:13:40 -04:00
Sam Lantinga
9fdb06450d
Added support for the Joy-Con Charging Grip when SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS is enabled
2021-08-04 11:34:06 -07:00
Sam Lantinga
9b4884d58a
Warn if you're building a partially functional RAWINPUT driver without device notifications
2021-08-03 09:25:14 -07:00
Sam Lantinga
886eb02eba
Fixed detection of Steam Virtual Gamepad with the WGI driver
2021-08-03 09:25:14 -07:00
Sam Lantinga
7c63e1d37a
Added WGI mappings for the Amazon Luna and Google Stadia controllers
2021-08-03 09:25:14 -07:00
Sam Lantinga
99c8972b25
Added WGI mappings for PS4 and PS5 controllers
2021-08-03 09:25:14 -07:00
Sam Lantinga
2dfc92ca1e
Added default mapping for WGI game controllers
2021-08-03 09:25:13 -07:00
Sam Lantinga
993a56766d
Only use the default Xbox mapping on Linux
...
On Windows, this is already covered by XInput and is the wrong mapping if we try to use it with DirectInput/RAWINPUT/WGI controllers
2021-08-03 00:15:24 -07:00
Sam Lantinga
7edc7d5392
Added a mapping for the Steam Virtual Gamepad when it's detected in DirectInput mode
2021-08-02 22:45:07 -07:00
Ryan C. Gordon
834a84fabb
winrt: Don't use LoadLibraryA on WinRT.
...
This removes the CM_Register_Notification code on WinRT. Note
that this API _is_ available to UWP apps as of Windows 10.0.17763
(version 1809, released October 2018), according to:
https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-devices-config-l1-1-1dll
So it might be worth readding with some sort of preprocessor check
for minimum targeted version, or whatever is appropriate for WinRT
development.
2021-08-03 05:07:39 -04:00
Sam Lantinga
022235012c
Fixed crash if WGI didn't give us the name for a controller
2021-08-02 16:40:58 -07:00
Sam Lantinga
2d0075eff8
Updated comments for third party Nintendo Switch controllers
2021-07-30 18:23:43 -07:00
Sam Lantinga
16010f7561
Added support for the PowerA Nintendo Switch Fusion Arcade Stick
2021-07-30 18:23:43 -07:00
Sam Lantinga
b33f470901
Fixed detection of the PDP Afterglow Wireless Switch Controller over Bluetooth
2021-07-30 18:23:42 -07:00
Sam Lantinga
6af6950dbc
Added support for the Victrix Gambit Tournament Controller
2021-07-30 18:23:42 -07:00
Sam Lantinga
243a8836af
The PowerA Nintendo Switch Fusion Pro Controller has a working USB mode, enabled via the switch on the underside of the controller.
2021-07-30 18:23:41 -07:00
Sam Lantinga
9d457aa446
Don't uninitialize COM because of what appears to be a bug in Microsoft WGI reference counting.
...
This fixes https://github.com/libsdl-org/SDL/issues/4488
2021-07-29 14:25:13 -07:00
Sam Lantinga
b3a0174b26
Scale the values correctly based on the sensor type (thanks @meyraud705)
2021-07-29 14:25:13 -07:00
Sam Lantinga
a186a503e7
Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller.
2021-07-29 06:43:39 -07:00
Sam Lantinga
2a53f8315a
Fixed controllers showing up under both MFI and HIDAPI drivers
...
The Game Controller Kit doesn't show the controllers at startup, so the HIDAPI driver sees them first and therefore gets preference when a controller is supported by both drivers.
This fixes bug https://github.com/libsdl-org/SDL/issues/4209
2021-07-26 23:29:20 -07:00
Sam Lantinga
46869db01c
Fixed controller rumble on macOS
...
Needed to add a strong reference to the haptics engine
2021-07-26 23:27:13 -07:00
Sam Lantinga
a850fec733
Added missing mapping for the Xbox Elite Controller on Linux
...
This fixes https://github.com/ValveSoftware/steam-for-linux/issues/7826
2021-07-26 15:05:02 -07:00
Sam Lantinga
ba8bc143c1
Sort joystick entries in /dev/input
...
This fixes https://github.com/libsdl-org/SDL/issues/4430
2021-07-26 12:09:33 -07:00
Sam Lantinga
8d527def81
Revert "hidapi_switch: Implement HD rumble effect ( #4538 )"
...
This reverts commit 19082b115b
, which broke rumble on the Nintendo Switch Pro controller
2021-07-26 10:18:18 -07:00
Narr the Reg
19082b115b
hidapi_switch: Implement HD rumble effect ( #4538 )
2021-07-26 10:00:53 -07:00
Sam Lantinga
10ec4c8671
Added support for the PowerA Nintendo Switch Spectra Controller
2021-07-24 22:11:22 -07:00
Sam Lantinga
3c9559f765
Don't try to rumble third-party Nintendo Switch Pro controllers
...
Sending rumble to the PowerA Spectra Nintendo Switch controller hangs input reports for a couple of seconds.
2021-07-24 19:43:56 -07:00
Sam Lantinga
cc19b13bc3
Fixed missing return statement
2021-07-24 19:21:29 -07:00
Sam Lantinga
d4ac6b5ed9
Detect buffer overflow when getting DirectInput device state
...
This fixes bug https://github.com/libsdl-org/SDL/issues/4528
2021-07-24 15:58:33 -07:00
Ryan C. Gordon
5ae0dd4b52
joystick: Split out Linux opening code for reuse by querying code.
...
This prevents an assertion whem LINUX_JoystickGetGamepadMapping tried to
open the stick temporarily and messed with global state by doing so. Now
the global state is only set in LINUX_JoystickOpen, but the common code
is shared by both interfaces.
Fixes #4198 .
2021-07-24 17:48:26 -04:00
Sam Lantinga
09d1cea733
Use the new controller type for the Luna and Stadia controllers
2021-07-24 11:15:09 -07:00
Sam Lantinga
808c3ae612
Allow mapping Android controllers that just have a D-PAD and face buttons
...
This fixes bug https://github.com/libsdl-org/SDL/issues/4327
2021-07-24 10:37:42 -07:00
Sam Lantinga
94b7a87645
Added SDL_GameControllerType enumerations for the Amazon Luna and Google Stadia controllers
...
Fixes bug https://github.com/libsdl-org/SDL/issues/4019
2021-07-24 09:10:18 -07:00
german77
e6e8fe6d4e
hidapi_switch: Implement analog rumble
2021-07-24 01:06:05 -07:00
Sam Lantinga
669714cafe
Added the ThrustMaster T.16000M as a flightstick
2021-07-23 23:51:35 -07:00
Sam Lantinga
384d86b584
Fixed compile warnings with Visual Studio
2021-07-23 23:48:23 -07:00
Sam Lantinga
adb75d642c
Fixed hotplug detection not working on UWP or when SDL isn't pumping Windows events
...
This fixes bugs:
https://github.com/libsdl-org/SDL/issues/4321
https://github.com/libsdl-org/SDL/issues/4147
Thanks to DJm00n for the suggestion!
2021-07-23 23:45:18 -07:00
Sam Lantinga
422b053b96
Added support for the full line of current PowerA Xbox Series X controllers
2021-07-23 16:32:35 -07:00
Sam Lantinga
dc6f044309
Added mapping for the Xbox Series X controller on tvOS
2021-07-12 17:57:21 -07:00
Sam Lantinga
947ad6e13a
Added support for the Xbox Series X controller on iOS and tvOS
2021-07-12 17:57:21 -07:00
Sam Lantinga
24059a19c5
The RAWINPUT driver is no longer tied to HIDAPI in any way
2021-07-09 18:11:42 -07:00
Sam Lantinga
d135c0762f
Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers
...
See testgamecontroller.c for an example of a custom PS5 trigger effect
2021-07-08 13:22:41 -07:00
Sam Lantinga
4a20dd3e54
Removed unnecessary comment, the mic button is in byte 16 on all firmware versions
2021-07-08 07:38:18 -07:00