Commit Graph

669 Commits

Author SHA1 Message Date
Sam Lantinga
4669ed0efa Added support for an XBox One wired controller for Leo Lännenmäki 2017-07-11 19:27:50 -07:00
Philipp Wiesemann
2c6817ba86 linux: Changed internal functions to be static. 2017-06-11 22:30:58 +02:00
Philipp Wiesemann
ffeb3167b2 Removed unused hint includes. 2017-06-08 22:40:09 +02:00
Philipp Wiesemann
9a39e8d796 Removed duplicate includes. 2017-06-04 23:15:47 +02:00
Philipp Wiesemann
1646a146e8 emscripten: Changed internal functions to be static. 2017-05-12 23:01:17 +02:00
Philipp Wiesemann
ea5a592da1 haiku: Fixed crash on quit if max number of joysticks was connected. 2017-05-07 21:02:46 +02:00
Sam Lantinga
563a43b215 Added Steam Controller mappings for Linux and iOS 2017-04-27 15:52:37 -07:00
Sam Lantinga
b19130eba6 Added support for the Cyborg V.3 Rumble Pad and the Mad Catz FightPad PRO 2017-04-07 03:39:43 -07:00
Sam Lantinga
fd4a5bf1c3 Implemented Linux joystick blacklist
Based on https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py

This fixes a few devices that are not actually joysticks showing up as such in SDL
2017-04-06 06:30:43 -07:00
Sam Lantinga
25b0217c45 Added support for a number of game controllers, including the Nintendo Switch Pro Controller 2017-04-04 08:43:44 -07:00
Sam Lantinga
df012aa40d Updated axis/button mapping for Dualshock 3, for upcoming Sony driver changes 2017-03-23 13:53:09 -07:00
Sam Lantinga
e147ccd615 Added an API to get the joystick instance ID before opening the device: SDL_JoystickGetDeviceInstanceID() 2017-03-09 16:09:16 -08:00
Ryan C. Gordon
cf875b61dd Fix some more compiler warnings on armcc. 2017-03-03 16:38:17 -05:00
Sam Lantinga
ffef80b48e Added config for the Razer Wildcat on Mac OS X 2017-02-20 11:02:35 -08:00
Sam Lantinga
2a137f0858 Added support for the Razer Wildcat on Linux 2017-02-17 17:46:58 -08:00
Philipp Wiesemann
9146d301e1 Windows: Fixed warning about unused variable.
Found by buildbot.
2017-02-03 23:30:43 +01:00
Sam Lantinga
82adccc15e Fixed build on Apple TV 2017-02-02 16:56:02 -08:00
Sam Lantinga
8ba3ebfa14 Remember XInput controllers that we've already seen, so when the raw device list changes we don't assign the old device to the new XInput userid.
This isn't perfect, but at least we won't report the same device twice.
2017-02-02 17:33:40 -08:00
Sam Lantinga
58b2cc2083 Added support for the Saitek Pro Flight X-56 Rhino 2017-01-31 12:30:55 -08:00
Sam Lantinga
88be409a04 Added support for the HOTAS Warthog throttle 2017-01-31 12:23:29 -08:00
Sam Lantinga
eb445857f5 Added the HOTAS Warthog as a flight stick 2017-01-31 10:20:09 -08:00
Sam Lantinga
83b9aad218 Sorted controller entries 2017-01-27 18:06:50 -08:00
Jessica Stokes
5dbf79b8ac Add a mapping for Xbox Wireless Controllers running old firmware
Also updates the naming of these Xbox Wireless Controllers connected via USB (and thus the third-party Xbox Controller Driver) to match.

The Xbox Wireless Controller entries are now listed, in order, via USB, bia Bluetooh (with older firmware) and via Bluetooth (with firmware 3.1.1221.0).
2017-01-26 21:25:05 -08:00
Sam Lantinga
1497154e59 Added Thrustmaster Wheel FFB entry to the list of wheels 2017-01-27 06:05:50 -08:00
Sam Lantinga
9cff625c90 Added an API to get the type of a connected joystick 2017-01-27 05:59:58 -08:00
Misty De Meo
b2fd805192 Add gamecontrollerdb mapping for Xbox One S on Mac
This is valid for firmware version 3.1.1221.0; earlier versions of the
firmware need a different mapping (and have different GUIDs).
2017-01-25 22:24:54 -08:00
Misty De Meo
9f6b0c5048 Darwin: fix detection of Xbox One S controller
Firmware revision 3.1.1221.0 changes the mapping of the Xbox One S
controller in Bluetooth mode. Aside from changing the layout of
other buttons, this revision also changes the triggers to act as
Accelerator and Brake axes from the simulation controls page.

The Darwin sysjoystick code didn't previously map anything at these
axes, making it impossible to detect input on these two buttons.
2017-01-25 22:22:05 -08:00
Sam Lantinga
2e6f3f1808 Added support for the 8Bitdo Zero GamePad 2017-01-20 08:13:23 -08:00
Sam Lantinga
9ac97dd412 Removed unused variable 2017-01-18 12:19:57 -08:00
Sam Lantinga
9fa40e721d Fixed bug 3533 - Enumeration joystick devices omitted during directinput enumeration
white.magic

The logic which decides if a device enumerated via the direct input system in the function EnumJoysticksCallback in SDL_dinputjoystick.c is processed is discarding valid joystick devices due to the assumption that devices of the type DI8DEVTYPE_SUPPLEMENTAL are not valid devices.

This change was added with 2.0.4 with this commit http://hg.libsdl.org/SDL/rev/d5adc0c06a03 that is linked to this bug report https://bugzilla.libsdl.org/show_bug.cgi?id=2460 which indicates that in that case devices of the type DI8DEVTYPE_SUPPLEMENTAL were not desirable as they caused a singular device to emit multiple "device added" events.

Since then there appear to have been a few fixes to handle devices that fall into various other classes in the following two commits:
http://hg.libsdl.org/SDL/rev/b9488c689ce3 and http://hg.libsdl.org/SDL/rev/161fee58e36f

Two devices I have reports of failing to be listed when the DI8DEVTYPE_SUPPLEMENTAL type is excluded are ECS Gametric Throttle and Thrustmaster MFD Cougar.

Sam Lantinga

I verified that the OUYA controller shows up as a single device with this change, so I've reverted the change to ignore supplemental devices, leaving framework in place to easily add devices that we want to ignore.
2017-01-18 12:18:50 -08:00
Sam Lantinga
83184dca24 Fixed building with mingw32 2017-01-18 11:57:27 -08:00
Philipp Wiesemann
35743474ce Fixed comments. 2017-01-14 21:36:06 +01:00
Sam Lantinga
1a6d67b9f4 Added mappings for the 8Bitdo NES30 Pro and iBuffalo SNES Controller
Also swapped the Wii U Pro controller button mappings to position instead of label, as emulators expect from XBox controllers.
2017-01-07 13:47:34 -08:00
Ryan C. Gordon
bda48fafc9 Replaced a few single-line "//" comments. 2017-01-07 17:09:14 -05:00
Sam Lantinga
8aadb53049 Fixed build warning on Haiku 2017-01-05 02:53:29 -08:00
Sam Lantinga
1e81ac1559 Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value.
This is useful for controller mapping programs to determine an axis' zero state
2017-01-04 10:28:07 -08:00
Sam Lantinga
999abbda52 Assume D-pad or thumbstick style axes are centered at 0 2017-01-04 07:06:48 -08:00
Sam Lantinga
b5558339f4 Added mappings for several GameCube and SNES controllers 2017-01-04 06:21:17 -08:00
Sam Lantinga
7eb2170c58 Added the NEXT SNES Controller to the list of zero-centered joysticks 2017-01-04 06:19:56 -08:00
Sam Lantinga
0e28ded311 Increased joystick jitter tolerance for PS3 controllers 2017-01-04 05:56:47 -08:00
Sam Lantinga
c9ed79623c Fixed binding the D-pad on some Super NES style controllers
Fixed a case where partial trigger pull could be bound to another button

There is a fundamental problem not resolved by this commit:

Some controllers have axes (triggers, pedals, etc.) that don't start at zero, but we're guaranteed that if we get a value that it's correct. For these controllers, the current code works, where we take the first value we get and use that as the zero point and generate axis motion starting from that point on.

Other controllers have digital axes (D-pad) that assume a zero starting point, and the first value we get is the min or max axis value when the D-pad is moved. For these controllers, the current code thinks that the zero point is the axis value after the D-pad motion and this doesn't work.

My hypothesis is that the first class of devices is more common and that we should solve for that, and add an exception to SDL_JoystickAxesCenteredAtZero() as needed for the second class of devices.
2017-01-03 23:39:28 -08:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Philipp Wiesemann
ca476cf958 Fixed crash if allocating memory for game controller failed. 2016-12-28 20:10:48 +01:00
Sam Lantinga
abbbf7e924 Fixed comment style 2016-12-27 02:04:38 -08:00
Sam Lantinga
bdd7e6b176 Split controller axes into positive and negative sides so each can be bound independently.
Using this a D-Pad can be mapped to a thumbstick and vice versa.
Also added support for inverted axes, improving trigger binding support
2016-12-27 01:39:07 -08:00
Sam Lantinga
7f0b81eebd Fixed bug 3517 - Compiler warnings with gcc -Wstrict-prototypes
felix

Compiling even a simple SDL2 'hello world' program with gcc -Wstrict-prototypes (GCC 6.2.1) results in warnings like:

/usr/include/SDL2/SDL_gamecontroller.h:143:1: attention : function declaration isn't a prototype [-Wstrict-prototypes]
 extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings();
 ^~~~~~

It seems there is a missing 'void' between the parentheses.
2016-12-26 02:12:21 -08:00
Philipp Wiesemann
2e0077f026 Windows: Fixed compile error. 2016-12-23 20:36:24 +01:00
Sam Lantinga
a252b4d73d Removed debug print statements 2016-12-23 02:23:44 -08:00
Sam Lantinga
46dd5015df Fixed compile errors on various platforms 2016-12-22 18:43:00 -07:00
Sam Lantinga
d016c5e57c Fixed issue where the throttle and other axes on racing wheels don't start at zero and show up as immediate input when the wheel is turned for the first time. Wait until they are actually moved before generating input from them. 2016-12-22 17:33:45 -08:00