src/joystick


Log

Author Commit Date CI Message
Sam Lantinga b98808f6 2019-11-28T14:23:24 Updated DPAD binding for 8Bitdo Zero controller
Sam Lantinga 2fd3f756 2019-11-28T11:44:17 Fixed trying to use the HIDAPI driver for the original Xbox One S Bluetooth controller
Sam Lantinga 8aaf945b 2019-11-28T11:44:15 Fixed mapping controllers that have axes that start at -32768 and then snap to 0 at the first input report
Sam Lantinga a3a8fcef 2019-11-28T10:04:05 Added support for the 8Bitdo SN30 Pro, wired connection
Sam Lantinga 4a776138 2019-11-27T18:26:57 Added the full Xbox One Elite Series 2 controller initialization sequence, to start input reports after switching out of Bluetooth mode.
Sam Lantinga b8d65da4 2019-11-27T15:27:21 Check for duplicates in the supported controller list
Sam Lantinga 0b863f8a 2019-11-27T15:27:19 Sorted controller entries by type and VID/PID to more easily find entries in the list
Sam Lantinga 84f8e53c 2019-11-27T15:27:16 Fixed detection of the Mad Catz FightPad Pro
Sam Lantinga 98cc9cf2 2019-11-27T12:38:53 Added support for the Google Stadia Controller
Sam Lantinga 43cb7b3c 2019-11-27T12:38:51 Added support for the Hori Fighting Commander
Sam Lantinga a76e5474 2019-11-27T12:38:48 Added support for the PowerA XB1 Fusion Fight Pad
Sam Lantinga a5e6b87c 2019-11-26T08:35:41 Added support for a variant of the PowerA FUSION Pro Controller
Sam Lantinga f3d95396 2019-11-25T15:02:54 Added some missing controller names
Sam Lantinga 8243a3e8 2019-11-25T15:02:50 Added support for the Hyperkin X91
Sam Lantinga 2713a1aa 2019-11-25T13:27:26 Moved the SteelSeries controllers into the "known controller" section
Sam Lantinga 26d53fbb 2019-11-25T11:12:09 Updated identification for the SteelSeries Stratus Duo
Sam Lantinga 359ae75b 2019-11-23T12:11:16 Fixed DragonRise Generic USB PCB showing up as a PS3 controller
Sam Lantinga 8e153922 2019-11-22T17:46:30 This packet didn't end up being needed to initialize input for the Xbox One Elite Series 2 controller
Sam Lantinga 6dce9733 2019-11-22T16:23:37 Use SDL_zeroa() appropriately
Sam Lantinga 733f2525 2019-11-22T14:09:24 Fixed build
Sam Lantinga 13006ba9 2019-11-22T13:44:40 Added support for the PDP Versus Fighting Pad
Sam Lantinga b5aff9d7 2019-11-22T13:12:12 Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to return the type of controller attached.
Sam Lantinga c0650aca 2019-11-21T14:04:48 Added support for the PDP Battlefield One controller
Sam Lantinga a132b183 2019-11-21T13:09:00 Fixed the guide button on the NVIDIA Controller v01.04
Sam Lantinga cc4f8905 2019-11-21T12:11:47 Added support for the NVIDIA Controller v01.04 on Linux and Mac OS X
Sam Lantinga 2a7b635b 2019-11-21T11:52:50 Added support for the NVIDIA Controller v01.04 on Android
Sam Lantinga 51487a71 2019-11-21T10:14:57 Added support for the MOGA XP5-A Plus
Sam Lantinga 65096446 2019-11-20T16:42:50 Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp()
Sam Lantinga ce8411c5 2019-11-20T08:43:24 Fixed Xbox One Elite Series 2 showing up as 2 devices in Bluetooth mode on Windows
Sam Lantinga 972a70d8 2019-11-19T15:15:00 Added support for the Xbox One Elite Series 2 controller on Mac OSX
Sam Lantinga 68d8fc5c 2019-11-18T15:46:13 Added support for the Xbox One Elite Series 2 controller in wired mode
Sam Lantinga 2bfcf5cd 2019-11-18T14:08:05 Added Linux controller mapping for the Xbox One Elite Series 2 controller in Bluetooth mode
Sam Lantinga 1e24a151 2019-11-18T11:51:39 Added names for some missing Xbox controllers
Sam Lantinga 14495644 2019-11-18T11:44:51 Added identifiers for the Xbox One Elite Series 2 controller
Sam Lantinga a9ac9e38 2019-11-16T19:58:29 Don't try to use this driver with the Xbox One S in Bluetooth mode on Linux
Sam Lantinga 9ca53730 2019-11-16T19:55:53 Added support for the Xbox One S controller in Bluetooth mode on Linux
Sam Lantinga cf33f1f0 2019-11-13T21:53:01 Added a utility function to simplify the hint handling logic
Sam Lantinga 9a76bebf 2019-11-13T14:24:48 SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS defaults to true, to match Steam's default behavior
Sylvain Becker 60d3965e 2019-10-30T15:36:17 Readability: remove redundant return, continue, enum declaration
Sylvain Becker 0f871c03 2019-10-23T09:53:23 Fixed bug 4843 - Passing NULL to memset in SDL_PrivateLoadButtonMapping (Thanks!)
Sylvain Becker b7ab3b39 2019-10-23T08:50:57 Fixed bug 4838 - Use after free in SDL_JoystickUpdate (Thanks!)
Sam Lantinga 5025109f 2019-10-22T15:43:58 Fixed accidental whitespace
Sam Lantinga 9da4bfc1 2019-10-22T10:57:07 Added support for the Power A Nintendo Switch Enhanced Wireless Controller
Sam Lantinga f96da11f 2019-10-22T10:28:51 Reordered Power A Switch controllers so they're grouped together
Sam Lantinga 9e7894ef 2019-10-22T10:27:30 Added support for the PowerA - Super Mario Controller
Sam Lantinga cdc7181e 2019-10-19T01:54:02 Don't try to use the Xbox HID protocol with the NVIDIA Shield controllers
Sam Lantinga 4f304fd8 2019-10-17T18:07:52 Added support for the BDA PS4 Fightpad
Sam Lantinga b3470f04 2019-10-17T17:32:47 Added the hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to control whether Nintendo Switch controllers use their button labels or button positions for game controller button reporting.
Sam Lantinga e6ac16ef 2019-10-17T16:59:05 Added support for third party Nintendo Switch controllers that don't support the full protocol
Sam Lantinga 43c5f62d 2019-10-17T16:14:17 Merged latest data from Steam
Sam Lantinga 3b3dbb5a 2019-10-01T08:50:04 Removed unused volume check interval
Sam Lantinga cbde0ffa 2019-09-19T16:50:49 The PS4 is ignoring the volume values in the report, so we don't need to fill them in.
Ozkan Sezer 9c8e403f 2019-08-30T11:35:20 use 'U' suffix on constants instead of (unsigned int) cast.
Sylvain Becker 70dc8d16 2019-08-30T08:55:20 Android: fix corresponding warnings
Sam Lantinga ce3b16fc 2019-08-26T10:08:25 Fixed bug 4475 - add Gasia Co. Ltd PS(R) Gamepad support Frank This gamepad/controller is sold in Germany https://www.amazon.de/gp/product/B01AQTPSA6/ref=ppx_yo_dt_b_asin_title_o03__o00_s00 but isn't supported right now. It identifies as "Gasia Co. Ltd PS(R) Gamepad"
Sam Lantinga d52ffcf9 2019-08-02T17:12:49 Added support for a few controllers on Android
Sam Lantinga c10a8742 2019-07-31T10:20:37 Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent()
Andrew Eikum c172f36b 2019-07-31T11:14:48 joystick: Ensure HIDAPI is initialized before calling it
Ozkan Sezer 4953e050 2019-07-31T05:11:40 use SDL_zeroa at more places where the argument is an array.
Ozkan Sezer 7a47c292 2019-07-31T01:22:02 Fix bug 4746 - introduce SDL_zeroa macro.
Sam Lantinga dc714389 2019-07-25T15:21:44 Don't call hid_enumerate() if the HIDAPI drivers are all disabled
Sam Lantinga a06d8cd0 2019-07-17T16:47:17 Merged latest changes from Steam into controller_type.h
Sam Lantinga 89de2512 2019-07-17T13:01:44 Added support for the Victrix Pro Fight Stick for PS4
Sam Lantinga 064d1223 2019-07-14T16:59:39 Fixed bug 4723 - Generic Xbox pad controller bindings seem odd/broken alexrice999 I have a knock off wired xbox 360 controller called afterglow for xbox 360 controller. Despite there being a few afterglow controllers in the controller mapping the guid of my controller seems to map to Generic Xbox pad. This binding is as follows: ``` "030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", ``` When running openmw I have a strange issue that the joysticks work for up and down movements but not for side to side. I managed to track this down to the side to side events being classified as joystick events instead of gamepad events. I believe this is due to both "leftstick" and "leftx" being bound to "a0" which seems odd to me. If I change openmw's mappings to remove these the controller works as expected. I was hoping someone who knows a lot more than me (as I have only been exploring this today trying to fix my controller) would know what is happening
Ryan C. Gordon 73536d93 2019-07-12T21:28:43 ios: Fixed MFi guide button not being detected (thanks, Caleb!). Fixes Bugzilla #4721.
Sam Lantinga 797d2c59 2019-06-30T22:48:13 Fixed bug 4436 - [OpenBSD] fix D-pad daniel.c.sinclair Hi, this patch breaks dpad/hat input on my PS4 controller. The attached patch restores functionality. Calling SDL_PrivateJoystickHat() at the end of BSD_JoystickUpdate was setting the hat state to zero on every kind of input, instead of just the HUG_DPAD events.
Cameron Gutman a4bfe2a4 2019-06-24T21:08:26 Allow hotplugging joysticks without udev
Sam Lantinga be6cda9f 2019-06-19T15:54:21 Rolling back GameCube HIDAPI support It causes the HIDAPI devices to always be opened on enumeration, which causes crashes in the Windows drivers when multiple applications are reading and writing at the same time. We can revisit this after 2.0.10 release.
Zack Middleton 56e2b9a4 2019-06-19T06:43:54 Handle GameCube WaveBird controller differences Make wireless GameCube controllers use unknown power level instead of wired and don't allow rumble (it doesn't have hardware for it).
Zack Middleton 6f63c1c3 2019-06-19T06:43:36 Make GameCube controllers only rumble if both USB cables are connected The Nintendo USB GameCube Adapter has two USB connectors. Black for data and grey for additional power for rumble. The Wii U and other software require both cables to use rumble. The rumble is weaker without the second USB cable. Other than that I don't know if there is any negative side affects from using rumble with only one cable.
Zack Middleton b23cce28 2019-06-19T06:43:04 Fix GameCube controller power level being reset to unknown HIDAPI_DriverGameCube_OpenJoystick() set power level to wired and then it was set to unknown in SDL_JoystickOpen().
Sam Lantinga 4eb3c0c3 2019-06-14T13:56:52 Added support for Xbox and PS4 wireless controllers on iOS and tvOS Also implemented SDL_JoystickGetDevicePlayerIndex() on iOS and tvOS, and added support for reading the new menu button state available in iOS and tvOS 13.
Sam Lantinga 747df96e 2019-06-12T10:38:49 Better patch to make it more clear what's going on
Sam Lantinga 3fbaa5da 2019-06-12T10:35:47 The hat index passed to the application should be zero-based with no holes
Sam Lantinga a1a2f9b9 2019-06-12T10:32:36 Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux) Matteo Beniamino Pressing a trigger button on a Steam Controller causes a segmentation fault both with stable version and latest mercurial head on Linux. I'm using the recent hid_steam kernel module with lizard_mode disabled (that is no keyboard/mouse emulation). I suspect this is what's happening: the driver exposes two hats. The two hats have indices 0 and 2. Inside linux/SDL_sysjoystick.c two hats are allocated in allocate_hatdata for joystick->hwdata->hats. In HandleHat function the hat parameter (that can be 2) is directly used as the index of the array that only has two elements, causing an out of bounds access. SDL is not expecting to have "holes" between hats indices. The index 2 is calculated in HandleInputEvents() as (ABS_HAT2X - ABS_HAT0X) / 2 where ABS_HAT2X is the value associated to the hat inside the hid_steam module.
Sam Lantinga a73dacbf 2019-06-08T14:58:49 Backed out Ben's chinese Xbox controller patch, as the generic catch-all for Xbox controllers should handle it.
Sam Lantinga 56b7f4cf 2019-06-08T14:40:27 Fixed bug 4583 - PollAllValues appears to use an incorrect index for all axes above 0x18 Noam Preil In src/joystick/linux/SDL_sysjoystick.c: The ConfigJoystick function's axes detection starts with a for loop using an index i for Linux's axes names. When i gets to ABS_HAT0X, it's set to ABS_HAT3Y and a continue statement appears, to skip the hats. This makes sense, as SDL handles hats separately from axes. However, in PollAllValues, *two* indices are used: a and b. Both start out the same, and remain so until the hats are reached. At that point, a becomes identical to the i from ConfigJoystick's loop, but b is equal to a - (ABS_HAT3Y - ABS_HAT0X), or a - 8. While all the joystick->hwdata->abs_* structures in ConfigJoystick used i - which would here be a - as both the index and the ioctl argument, PollAllValues uses b for the structure index and a as the ioctl argument. It would appear, however, that no joystick HAS such axes, and that the b index is entirely unnecessary. I tested three separate joysticks, and while that was far from a complete listing, I was unable to find a joystick with an axis above 0x08.
Sam Lantinga d97387cc 2019-06-08T14:32:19 Fixed bug 4600 - Dualshock 4 touchpad press is not detectable with SDL_JoystickGetButton Dexter Friedman When using a Dualshock 4 controller (model numbers CUH-ZCT1U and CUH-ZCT2U), pressing anywhere on the center touchpad does not send an SDL_JOYBUTTONDOWN event. I have verified this with testjoystick: Repro steps: 1. Plug in a DS4 over USB 2. Compile testjoystick and run: testjoystick.exe 0 3. Press and hold the touchpad. Observe that no lime green box appears Expected behavior: A lime green box appears while the touchpad is pressed. Notes: I've attached a patch here that works on my PC and produces the expected behavior in testjoystick, for both DS4 model numbers I listed earlier. If I understand correctly, by exposing this as a joystick button, the gamecontroller API mapping can be modified with a change to gamecontrollerdb.txt in the future.
Zack Middleton 82af4276 2019-06-08T13:36:59 hidapi: Use GameCube adapter controller port for player index The Nintendo USB GameCube adapter has four controller ports. Return the port number as 0 to 3 from SDL_JoystickGetPlayerIndex() and SDL_JoystickGetDevicePlayerIndex().
Sam Lantinga 9261e473 2019-06-07T09:00:24 Potential fix for a crash we're seeing on Android that should in theory never happen.
Sam Lantinga 20ec8664 2019-06-06T08:20:53 Added support for the Rotor Riot gamepad, and upcoming Xbox and PS4 controller support on iOS and tvOS Patch contributed by Nat Brown
Sam Lantinga 5f341620 2019-05-19T12:06:58 Fixed bug 4474 - Add support for an ASUS Gamepad variation Trent Gamblin This patch adds a variation of the ASUS Gamepad to the game controller DB. All the values are the same except the GUID.
Sam Lantinga c377de54 2019-05-19T11:56:26 Fixed bug 4436 - [OpenBSD] fix D-pad Thomas Frohwein Hi, If a gamepad lists the Dpad as 4 buttons (Dpad Up,Down, Left, Right) like with the Xbox 360 gamepad / XInput report descriptor used by OpenBSD (https://github.com/openbsd/src/blob/master/sys/dev/usb/uhid_rdesc.h#L184), this is not recognized by the SDL BSD backend and no hat or any other listing for the D-pad exists, e.g. in sdl2-jstest (https://gitlab.com/sdl-jstest/sdl-jstest). The attached diff fixes this and makes the D-pad on my Xbox 360 and Logitech F310 controllers usable. It adds a hat to nhats when usage HUG_DPAD_UP is found, reads the state of the D-pad buttons into array dpad[], and turns the value of dpad[] into an SDL hat direction (dpad_to_sdl()). Tested and works with Xbox 360 controller and Logitech F310 in XInput mode. Software-side tested with sdl2-jstest and Owlboy where this worked without problems or regressions. I don't know if this would be applicable to other *BSDs and don't have an install to test it with, therefore wrapped it in __OpenBSD__ ifdefs. Thanks, thfr
Cameron Gutman 5cb14f44 2019-04-30T20:37:49 Ignore Xbox One S gamepads with older firmware in HIDAPI This older firmware had a different HID report style that we don't support.
Sam Lantinga 9a8d5215 2019-03-27T08:17:05 Handle potentially calling SDL_JoystickUpdate() and SDL_JoystickQuit() at the same time.
Benjamin Valentin 1e8d9e01 2019-03-17T23:47:12 Add mapping for Chinese-made Xbox Controller This device is a copy of the Xbox Controller S and currently the one most sold when shopping for a 'new' Xbox gamepad on eBay and AliExpress. Except for the quirky USB ID id behaves just like a normal Xbox controller (when ignoring the subpar build quality)
Benjamin Valentin f3c6b1f5 2019-03-17T23:47:12 Add mapping for Chinese-made Xbox Controller This device is a copy of the Xbox Controller S and currently the one most sold when shopping for a 'new' Xbox gamepad on eBay and AliExpress. Except for the quirky USB ID id behaves just like a normal Xbox controller (when ignoring the subpar build quality)
Ethan Lee f07c992b 2019-03-17T12:36:40 hidapi: Add GCN L/R buttons, just in case someone wants them...
Sam Lantinga faf97978 2019-03-16T19:03:13 Fixed bug 4511 - SDL_gamecontrollerdb Mapping for Sony Playstation USB controller Renaud Lepage Simply submitting a new mapping.
Jimb Esser 0f148eb6 2019-03-16T18:12:26 Fix polling left trigger reporting right trigger's values.
Ethan Lee c5286156 2019-03-12T20:27:54 hidapi: Add support for Wii U/Switch USB GameCube controller adapter. Note that a single USB device is responsible for all 4 joysticks, so a large rewrite of the DeviceDriver functions was necessary to allow a single device to produce multiple joysticks.
Silent b6a45f1a 2019-02-14T20:46:58 Fixed DualShock 3 mapping
Alex Szpakowski 65e07b38 2019-01-31T19:52:47 iOS/tvOS: fix support for SDL_GameControllerGetButton(controller, GUIDE) with MFi controllers (thanks Caleb!) Fixes bug #4463.
Charlie Birks aacb1091 2019-01-29T12:19:00 Emscripten: call emscripten_sample_gamepad_data
Sylvain Becker 82b2c849 2019-01-21T23:41:43 Fixed bug 4024 - GameController error "Unexpected controller element" If mapping string is terminated with a comma, there is no more values to parse.
Sylvain Becker adabfdc0 2019-01-21T20:49:08 Revert SDL_gamecontrollerdb.h and sort_controllers.py from bug 4024
Sam Lantinga 7b354dda 2019-01-20T13:53:16 Fixed compiler warning
Sylvain Becker ede0fc4f 2019-01-16T14:03:35 Fixed bug 4024 - remove trailing comma of Controller mappings because it reports an error "Unexpected controller element"
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Ryan C. Gordon 18296927 2018-12-15T09:57:05 emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index.