Sam Lantinga
f205f3a8c2
Added support for the Razer Raiju Mobile
2018-11-27 15:10:26 -08:00
Sam Lantinga
b73703b9c6
Fixed bug 4391 - hid_enumerate() sometimes causes game to freeze for a few seconds
...
Daniel Gibson
Even though my game (dhewm3) doesn't use SDL_INIT_JOYSTICK, SDL_PumpEvent() calls SDL_JoystickUpdate() which ends up calling hid_enumerate() every three seconds, and sometimes on my Win7 box hid_enumerate() takes about 5 seconds, which causes the whole game to freeze for that time.
2018-11-19 21:17:00 -08:00
Sam Lantinga
2e348c1f59
Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick
...
maxxus
The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events. Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
2018-11-14 13:37:22 -08:00
Ryan C. Gordon
62494a2e27
Merge SDL-ryan-batching-renderer branch to default.
2018-10-31 15:03:41 -04:00
Steven M. Vascellaro
ff3bb857ff
joystick: Add Linux mappings for "Xbox One Wireless Controller (Model 1708)"
...
Adds controller bindings to support the "Xbox One Wireless Controller
(Model 1708)" on Linux. The Model 1708 was released in 2016 alongside the
Xbox One S. It is the current model being sold by Microsoft as of writing.
(October 22, 2018)
2018-10-22 10:55:18 -04:00
Ozkan Sezer
d42728ec10
fix NetBSD C90 build failure
...
src/vendor/SDL2/src/joystick/bsd/SDL_sysjoystick.c:353:5: error:
ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
reported by 'bch' at https://discourse.libsdl.org/t/25231
2018-11-01 12:35:00 +03:00
Micha? Janiszewski
91820998fc
Add and update include guards
...
Include guards in most changed files were missing, I added them keeping
the same style as other SDL files. In some cases I moved the include
guards around to be the first thing the header has to take advantage of
any possible improvements compiler may have for inclusion guards.
2018-10-28 21:36:48 +01:00
Sam Lantinga
14c55ac890
This change looks okay in the general case.
...
If we run into problems where these events aren't dispatched (initialized on a different thread than the main thread?) we may need to create a separate thread to handle device notifications like we do with the windows joystick subsystem.
2018-10-26 20:20:28 -07:00
Ryan C. Gordon
be8ef94f18
hidapi: Don't run a separate event loop for device notifications.
...
Fixes Bugzilla #4286 .
2018-10-26 14:43:39 -04:00
Sam Lantinga
14329256cb
Generalized the XInput user index into a player index
2018-10-25 16:53:14 -07:00
Sam Lantinga
545febcf21
Fixed initializing XInput user index
2018-10-25 13:22:34 -07:00
Sam Lantinga
9987ca69f3
Added SDL_JoystickGetXInputUserIndex()
2018-10-25 12:54:42 -07:00
Sam Lantinga
4d4e18c4bb
Added vi style for the Emscripten joystick code
2018-10-25 12:54:39 -07:00
Ryan C. Gordon
b262b0ebc9
Small stack allocations fall back to malloc if they're unexpectedly large.
2018-10-22 20:50:32 -04:00
Sam Lantinga
80021c21b6
Speculatively disable rumble on the Razer Panthera Evo, which doesn't have rumble motors and probably hangs in the same way the Panthera does.
2018-09-05 15:28:06 -07:00
Sam Lantinga
96259f1f85
Don't overwrite the default binding when changing the binding for a controller that was using the default.
2018-09-05 12:16:01 -07:00
Sam Lantinga
963e74d68c
Added binding for Mad Catz FightStick TE S+ (PS3) on Mac OS X
2018-09-05 11:24:23 -07:00
Sam Lantinga
c152e380be
Added support for the Razer Panthera Fightstick
...
Fixed bindings for the Mad Catz FightStick TE S+
2018-09-05 11:18:50 -07:00
Sam Lantinga
34237b80f4
Better fix to make sure we're only returning controllers from the HIDAPI joystick API
2018-08-31 18:10:21 -07:00
Sam Lantinga
4ffcd88ca2
Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID.
2018-08-31 17:47:34 -07:00
Sam Lantinga
5ef8eb49be
Don't show the Razer Raiju sound interface as a game controller
2018-08-29 20:55:02 -07:00
Sam Lantinga
207428b444
Don't rumble Bluetooth PS4 controllers by default, as that switches the controller into extended input report mode, which breaks games that use DirectInput.
2018-08-29 20:23:39 -07:00
Sam Lantinga
16ccff3c56
Fixed whitespace
2018-08-29 20:23:36 -07:00
Sam Lantinga
fda14741ac
Fixed Xbox One S Bluetooth support on Mac OS X
2018-08-29 18:56:54 -07:00
Sam Lantinga
708ad1fd8d
Fixed updating the rumble parameters on Linux
2018-10-16 14:58:07 -07:00
Sam Lantinga
62f806ed6c
This device gets Xinput driver loaded on windows.
2018-10-08 19:46:01 -07:00
Sam Lantinga
f01cdcedbc
It turns out HIDAPI for Xbox controllers doesn't allow background input, so we won't enable it by default on Windows.
2018-10-05 01:41:59 -07:00
Sam Lantinga
41ee51b9a8
Fixed updating bindings for controllers using the wildcard mappings
2018-10-04 15:23:42 -07:00
Sam Lantinga
1944556171
Make sure we don't read and write to HIDAPI at the same time, it's not thread-safe on Windows
2018-10-02 20:51:33 -07:00
Sam Lantinga
6b3f11e2a3
Fixed code style
2018-08-20 21:18:56 -07:00
Ozkan Sezer
90454b1ece
SDL_hidapi_ps4.c: define NTDDI_VISTA / _WIN32_WINNT_VISTA if not defined
...
it still needs a Vista or newer Platform SDK to build, though.
2018-08-16 11:01:02 +03:00
Sam Lantinga
7d3a7ef827
Use a single hint for both Xbox 360 and Xbox One controllers, since they are often the same driver.
2018-08-15 23:35:54 -07:00
Sam Lantinga
a2add1f683
Use the HIDAPI driver for Xbox controllers on Windows, and determine the XInput mapping at runtime for extended functionality like rumble and guide button.
2018-08-15 23:14:45 -07:00
Sam Lantinga
3f5ff751fe
Use a unified name list for Xbox 360 and Xbox One controllers for drivers that can handle both
2018-08-15 23:14:43 -07:00
Sam Lantinga
aad340eb86
Added Windows Xbox controller state packet handling, for completeness.
2018-08-15 19:53:36 -07:00
Sam Lantinga
63107524f6
Fixed input from the Steam Virtual Gamepad on Mac OS X
2018-08-15 19:53:34 -07:00
Sam Lantinga
0903e83553
Use SDL specific window class to avoid conflicting with Steam
2018-08-15 19:53:31 -07:00
Sam Lantinga
c88666580e
Catch device removal as well as device arrival on Windows
2018-08-15 19:53:30 -07:00
Sam Lantinga
641c674f2a
Turned off debug messages
2018-08-15 19:53:28 -07:00
Sam Lantinga
51902010c6
Remove the HIDAPI device if we get a read error from it
...
This fixes detecting PS4 controller disconnect on Mac OS X, where there isn't any device removed notification
2018-08-15 19:53:26 -07:00
Sam Lantinga
dfbd7f65a9
Fixed Mac OS X build
2018-08-15 19:53:24 -07:00
Sam Lantinga
ec74c318b9
Polling hid_enumerate() every 3 seconds causes freezes and stutters on some USB audio devices and mice.
...
We'll only enumerate devices when we get notification that the system devices have changed
2018-08-15 19:53:22 -07:00
Ryan C. Gordon
67a48ad13a
haiku: Patched to compile with new joystick interfaces.
2018-08-10 15:04:08 -04:00
Ryan C. Gordon
e1ac643b32
bsd: Patched to compile.
...
(I think.)
2018-08-10 14:54:26 -04:00
Ryan C. Gordon
67764070f0
bsd: Update joystick code for new interfaces.
...
(this is an untested push to see if buildbot likes it.)
2018-08-10 14:42:40 -04:00
Ryan C. Gordon
b692c35237
emscripten: Patched to compile with new joystick interfaces.
2018-08-10 14:32:30 -04:00
Ryan C. Gordon
941f8ecffd
joystick: define inline to SDL_INLINE
2018-08-10 14:10:47 -04:00
Ryan C. Gordon
0b2863d45e
joystick: #if 0'd out some things that aren't currently used.
...
Fixes some compiler warnings.
2018-08-10 14:09:44 -04:00
Ozkan Sezer
a7c3d2af81
SDL_hidapi_ps4.c: lowercase windows header names.
2018-08-10 11:50:55 +03:00
Sam Lantinga
4f41f07d43
Added missing files from previous commits
2018-08-09 16:05:48 -07:00
Sam Lantinga
31b0224397
Added notes that this code was contributed by Valve
2018-08-09 16:04:45 -07:00
Sam Lantinga
99759bac82
There's no controller that's supported by both XInput and HIDAPI
2018-08-09 16:04:34 -07:00
Sam Lantinga
ab07ce1166
Don't update the device list for devices we know aren't supported
...
This should reduce HID enumeration (hitting the USB bus) if for some reason we're getting spammed with false device insert/removal events
2018-08-09 16:04:30 -07:00
Sam Lantinga
28e0c0eef7
Sam Lantinga <slouken@libsdl.org> 2018-08-06 13:00 -0700
...
Backed out changeset 794a209b2270
http://hg.libsdl.org/SDL/rev/2e2ecdac957c
2018-08-09 16:04:21 -07:00
Sam Lantinga
25a952e76f
Sam Lantinga <slouken@libsdl.org> 2018-08-06 11:58 -0700
...
Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
http://hg.libsdl.org/SDL/rev/794a209b2270
2018-08-09 16:04:18 -07:00
Sam Lantinga
888bf1af69
Worked around bug with Sony PS Now PS3 controller where DirectInput polling will continue to return success after the controller is unplugged.
...
The code is now reliant on SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() being called correctly when devices are added or removed on Windows
2018-08-09 16:03:50 -07:00
Sam Lantinga
f35e97ba8a
Fixed Windows build
2018-08-09 16:03:29 -07:00
Sam Lantinga
d2042e1ed4
Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
...
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Sam Lantinga
a37d3e0b1e
Backed out changeset 794a209b2270
...
It turns out the mapping is correct, just the name was confusing
2018-08-06 13:00:11 -07:00
Sam Lantinga
cc682f2013
Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
...
Different device with same vid/pic that is kind of a Saitek shape:
https://www.trust.com/en/product/17416-gxt-24-runa-compact-gamepad
n64 with same ID
https://bbs.archlinux.org/viewtopic.php?id=163488
PS shaped with numbers for buttons
https://pineight.com/mw/index.php?title=USB_game_controller#DragonRise_Inc._Generic_USB_Joystick
fightstick with same vid/pid
https://retropie.org.uk/forum/topic/7594/bartop-2-player-zero-delay-encoders-not-working
2018-08-06 11:58:08 -07:00
Ryan C. Gordon
862aa4b47d
windows: Fixed some Visual Studio warnings about shadowed variables.
...
Fixes Bugzilla #4118 .
2018-07-22 19:28:27 -04:00
Sam Lantinga
48f7e7f34d
Corrected PS4 controller entry
2018-09-30 22:43:12 -07:00
Ozkan Sezer
5454765a22
replace bool stuff in controller_type.h with SDL_bool.
...
remove bool<->SDL_bool dance in SDL_joystick.c:SDL_IsJoystickSteamController()
after the controller_type.h change.
2018-09-28 17:01:24 +03:00
Ozkan Sezer
fde82e5972
SDL_hidapi_ps4.c: add HAVE_ENDPOINTVOLUME_H check to win32 volume code.
...
this makes it build with my old toolchain with mingw-w64 1.0.10 headers
2018-09-28 14:01:40 +03:00
Sam Lantinga
9aa8a75d26
Fixed building with Xcode 10.0
2018-09-28 01:18:54 -07:00
Sam Lantinga
f964ce03b4
Fixed mingw-w64 build
2018-09-28 01:00:47 -07:00
Sam Lantinga
aa9683bb6f
Added 8bitdo SF 30 PRO controller support for Linux / DInput mode (thanks Frank Hartung)
2018-09-25 19:41:33 -07:00
Ozkan Sezer
870c44bfed
safer this way, just in case..
2018-09-25 09:20:56 +03:00
Sam Lantinga
cd90e2ca58
Fixed bug 4267 - linkage failure with --enable-hidapi because of missing libudev symbols
...
Ozkan Sezer
hidapi dynamic udev initial patch
2018-09-24 16:33:14 -07:00
Sam Lantinga
5febdfcece
Fixed whitespace
2018-09-24 11:49:25 -07:00
Sam Lantinga
d07fe7ad95
Removed button logging message
2018-09-21 09:41:21 -07:00
Sam Lantinga
e8b0859f17
Added missing call to WindowsDeleteString()
2018-09-20 15:55:52 -07:00
Sam Lantinga
600126c90e
Added experimental support for Windows.Gaming.Input
2018-09-19 10:03:40 -07:00
Sam Lantinga
59a2d12cc3
Fixed creating an Android game controller mapping for HIDAPI devices on initialization
2018-09-17 11:35:22 -07:00
Sam Lantinga
6a7b0c27af
Fixed crash launching under Steam on Mac OS X
2018-09-14 12:41:29 -07:00
Ozkan Sezer
33381d3d10
hidapi/SDL_hidapijoystick.c: fix build in C90 mode:
...
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_InitializeDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: (Each undeclared identifier is reported only once
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: for each function it appears in.)
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_UpdateDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:339: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:341: error: ISO C90 forbids mixed declarations and code
2018-09-07 11:03:24 +03:00
Sam Lantinga
864b8f89fa
Merged in community contributed controller mappings from https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
2018-06-12 01:04:26 -07:00
Sam Lantinga
1205978244
Added common controllers used with Steam Big Picture
...
These are entirely untested
Several USB ids refer to multiple packaged products. In those cases I tried to use the most common name, or a general name (e.g. PS3 Controller), or a completely generic name (e.g. USB gamepad) if it wasn't clear what type of controller it was.
Patches welcome!
2018-06-12 00:18:10 -07:00
Sam Lantinga
db86e7a633
Added support for the PS3 controller driver in PlayStation Now
2018-06-07 10:54:54 -07:00
Sam Lantinga
ff6aebc4a1
Added a new GUID for DS3 controller connected over bluetooth, for both Sony and Shanwan (thanks William!)
2018-05-29 08:03:44 -07:00
Sam Lantinga
b3173d9d3b
Added support for the NVIDIA SHIELD handheld gaming device
2018-05-23 17:15:37 -07:00
Sam Lantinga
361043a5f6
Actually left trigger is motion axis 17 and right trigger is motion axis 18, which will map in that order to SDL axes.
2018-05-23 17:15:33 -07:00
Sam Lantinga
4d9a346927
Added additional supported Android controllers
2018-05-23 16:00:21 -07:00
Sam Lantinga
c07656dbcb
Fixed default mapping for Android controller triggers (they were reversed)
2018-05-23 16:00:19 -07:00
Sam Lantinga
999af8099b
Merged latest changes from Steam Link app
2018-05-18 13:09:30 -07:00
Sam Lantinga
b7228bc51f
Added support for the GameSir G3w
2018-04-11 18:28:03 -07:00
Sam Lantinga
b41b9d34c7
Fixed return value
2018-03-19 14:52:53 -07:00
Sam Lantinga
8e062f6925
Generalized the handling of instantaneous guide button presses so there's a minimum of 100 ms between guide button press and release.
...
This happens with at least the following controllers: All Apple MFI controllers, ASUS Gamepad, XiaoMi Bluetooth Controller
2018-03-19 14:42:51 -07:00
Sam Lantinga
d529b001bc
Added mapping for the ASUS Gamepad removing the guide button, which doesn't generate events even though it's reported in the Android APIs.
2018-03-19 13:16:11 -07:00
Sam Lantinga
129431b4f4
Delay delivery of the pause button release on MFI controllers so it doesn't happen in the same frame as the button press
2018-03-08 16:32:22 -08:00
Sam Lantinga
92847022f5
Added a mapping for the latest firmware for the Xbox One S controller on Android
2018-03-07 18:10:01 -08:00
Sam Lantinga
a2c1d83c02
Include a USB VID/PID for Apple MFI controllers
...
This is just placeholder VID/PID, but allows code that works with VID/PID to identify the MFI controllers easily.
2018-03-07 18:09:58 -08:00
Sam Lantinga
a8ac588549
Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened
2018-03-07 13:30:40 -08:00
Sam Lantinga
9e651b6915
Try to dynamically create a default Android game controller mapping based on the buttons and axes on the controller.
...
Include the controller USB VID/PID in the GUID where possible, as we do on other platforms.
2018-03-06 14:51:50 -08:00
Sam Lantinga
003c0dce9c
Use the real controller name for game controllers on iOS and Apple TV
2018-03-02 10:56:21 -08:00
Ethan Lee
6e3d0a133c
Use new XInput mapping for Win10+ (Bugzilla #3960 )
2018-02-21 12:42:30 -05:00
Sam Lantinga
7c36002739
Fixed compiler warning on Android
2018-02-09 16:01:11 -08:00
Sam Lantinga
965c11f38a
Fixed bug 4060 - Alternative DualShock 4 v2 controller GUID
...
ayer.3d
I have a DualShock 4 v2 controller with a GUID that's not in the database. There is an existing GUID that is almost identical, with the only difference that I can tell being the reported version string (mine being 8001, database is 8100).
Existing GUID: 050000004c050000cc09000000810000
New GUID: 050000004c050000cc09000001800000
When connected via USB, the GUID matches an existing entry: 030000004c050000cc09000011810000
2018-02-07 14:07:54 -08:00
Sam Lantinga
73c26c204c
Send Apple TV remote input as key events unless it's opened as a joystick, to match Android behavior.
2018-02-06 16:43:31 -08:00
Sam Lantinga
f59b9c8b13
Replaced SDL_HINT_APPLE_TV_REMOTE_SWIPES_AS_ARROW_KEYS with SDL_HINT_TV_REMOTE_AS_JOYSTICK which controls whether remotes on iOS and Android are interpreted as joysticks (the default) or as return/escape/arrow keys.
2018-02-06 15:03:38 -08:00