src/joystick


Log

Author Commit Date CI Message
Sam Lantinga e8ec8ba1 2023-04-27T17:10:44 Added support for the Astro C40 in Xbox 360 mode (cherry picked from commit a4b4dff4a2998699757f12d29fdd4c632db884fe)
Sam Lantinga d42c303b 2023-05-15T21:43:16 Check to make sure the Windows joystick device has buttons and axes This fixes incorrectly detecting the ROG CHAKRAM X mouse as a game controller on Windows 10 (cherry picked from commit 642504bc5993a6acd4d9c1d4c1314c6b1cf6e4e1)
Sam Lantinga f72213c4 2023-04-29T17:09:17 By default, OpenBSD uses Linux controller mappings Fixes https://github.com/libsdl-org/SDL/issues/7609 (cherry picked from commit 255c3b7c82968def667da860cbda01f267b4edf1)
Sam Lantinga 120bc77e 2023-04-19T13:10:39 Report PS3 accelerometer values in m/s2 instead of Gs (cherry picked from commit 0467301baf57389d96fafbe169fb07f4c10169bc)
Sam Lantinga 7ec9a438 2023-04-06T11:33:27 More defensive coding against dangling device pointers (cherry picked from commit acadb6f873acaa0de094ad10a88f877d540ce0ec)
Sam Lantinga cb0cf141 2023-04-06T09:54:04 The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors (cherry picked from commit 558bbbb07ae0afa0108c1560915351cfa13442b7)
Sam Lantinga f6363fde 2023-04-05T11:23:28 Fixed crash if joystick->hwdata != NULL && device->driver == NULL This should never happen, but we're seeing it in the wild, so make sure that we can never call into a NULL device driver. (cherry picked from commit e13b74ccf0b20a20bd4baf1617bdc4f84c13feb7)
Ozkan Sezer f6339154 2023-04-05T02:10:56 fix build after commit 22685556e5d9fc2e2a7023075e51b69fe770e64a.
Sam Lantinga 22685556 2023-03-30T07:36:40 Don't probe for PlayStation controllers when we already know the controller type Fixes https://github.com/libsdl-org/SDL/issues/7556 (cherry picked from commit 655a07bdd88d6bd19fe97c3abd39a2e2eef252ec)
Sam Lantinga f444eac5 2023-03-30T07:25:49 Fixed analog triggers on the DualSense controller (cherry picked from commit a67d41050164e447048fa55179cc31b23be9d9b7)
Sam Lantinga c2ee45f5 2023-03-28T15:14:00 The Xinmotek Controller is used in multiple products with different mappings The mapping included here is for the Ultimate Atari Fight Stick (cherry picked from commit f1099f8e70a1284c2ee3031f2ea0cfc84f22110c)
Sam Lantinga 0bf63175 2023-03-28T14:44:28 Fixed gyro values for the Armor-X Pro controller (cherry picked from commit 8df7b4d8539338121b1e34e29f331b28f1f4ff05)
Sam Lantinga d043c853 2023-03-28T12:28:15 Fixed the accelerometer and gyro axes for the Armor-X Pro controller (cherry picked from commit 37517557ae076cd94acd9ca3b739e1f32c150a43)
Anonymous Maarten 1402d135 2023-03-18T20:34:38 video/blit: fix -Wimplicit-fallthrough warnings (cherry picked from commit f7961b7c9ad598b031cd033f19e93c6d882e8e41)
Sam Lantinga 8bfbda1e 2023-03-27T14:27:22 Fixed the accelerometer sensitivity for the Armor-X Pro controller (cherry picked from commit 8029a767eef4147c07cde965bd5a2d2e11e237ee)
Sam Lantinga 93c289b4 2023-03-27T14:21:05 Increased precision for PS4 sensor data conversion (cherry picked from commit 3340864786314d77e04a0dd2bf1ebffbc43bfc31)
Pierre Wendling ed5a343d 2023-03-27T11:51:19 SDL_hidapi_steam.c: Fix compilation under c2x. When N2935 is implemented, the enum breaks compilation. Use a #define of the SDL booleans instead. (cherry picked from commit 975039ce0d3587c42e11f2922240957fc8f74166)
Sam Lantinga b57a6a1a 2023-03-16T20:01:45 Added gamepad mapping for Flydigi Vader 2 with the latest firmware (6.0.4.9) (cherry picked from commit ed0937598e0a637a1033c90a1b31886537bb288c)
Sam Lantinga 57ae9f46 2023-03-13T19:56:42 Ignore the PS4 packet CRC if it's not being set correctly This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode Fixes https://github.com/libsdl-org/SDL/issues/7270 (cherry picked from commit 3951cae4a56fddcb42ce4141a6518c97fa9125cd)
Rudolf Polzer dca3fd83 2023-03-11T12:02:17 Android: indicate gamepaddb entries where axis order changed. Axis order was changed in 6f1f586086a18ab32ddccc05e4616aac02774a1b to improve default mappings. (cherry picked from commit de3909a190f6e1a3f11776ce42927f99b0381675)
Sam Lantinga ab167038 2023-03-10T15:28:22 Added support for the trigger buttons on the Victrix Pro FS for PS5 (cherry picked from commit 8d7e61ea42364c256b76e7f6f2b6d6f90742bcb7)
Sam Lantinga 71dc7169 2023-03-09T17:18:40 Added header for SDL_Delay()
Sam Lantinga 1e6ffc62 2023-03-09T16:11:53 Removed a duplicate delay accidentally added during code refactor (cherry picked from commit 926db1bd544364a9e4ab61e60bcfbe75e05adf56)
Sam Lantinga 3f00fa16 2023-03-09T16:10:04 Wait for the GCController framework to see IOKit devices It occasionally takes a few millseconds for the GCController framework to handle the device notification and set up the device Fixes the duplicate controller issue in https://github.com/libsdl-org/SDL/issues/6686 (cherry picked from commit 645823fc901c98b688512d3b3e70cc8922e8140c)
Sam Lantinga 0d763800 2023-03-09T15:10:00 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!) (cherry picked from commit c6443d86c92e962683a1efe5f123a144988875b5)
Lokathor cfd6b34b 2023-03-08T17:18:50 Make mappings for "Retrolink SNES Controller" with `SDL_GAMECONTROLLER_USE_BUTTON_LABELS` both on and off I've only tested this on windows, but I went ahead and made the same changes for linux and mac because I assumed it's the same there and that we'd want to keep the three platforms in sync. (cherry picked from commit b8bc4a234b93efa7a28c7fd7d524d905d9b76e6d)
Ozkan Sezer a70964aa 2023-03-08T20:00:50 fix SDL_FindFreePlayerIndex so it can really return -1.
Sam Lantinga 35c13196 2023-03-08T08:40:38 Fixed uninitialized variable
Sam Lantinga 8fc10ac9 2023-03-06T15:36:49 Added mapping for the Xbox Elite Core controller connected via Bluetooth on Android (cherry picked from commit d08338ddc5bb3cae1e4ce06201a2cd3c53215aa0)
divVerent 91ad208d 2023-03-06T18:33:18 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405) (cherry picked from commit 6f1f586086a18ab32ddccc05e4616aac02774a1b)
Sam Lantinga f47a08ab 2023-03-01T16:47:48 Fixed typo in previous cherry-pick
Sam Lantinga 660fc899 2023-03-01T16:38:48 Don't clobber an existing entry with a different version when adding a gamepad mapping (cherry picked from commit 727c7d4e2f44102bb571180929bfbb5d527f4f27)
Sam Lantinga c0fb0924 2023-02-28T08:36:31 Fixed locking up the Logitech F310 with the PlayStation controller detection (cherry picked from commit da134a30396e12786c14fe8d1190ab05c67d9dba)
Sam Lantinga 715749f5 2023-02-27T15:19:34 Added mapping for DualSense Edge Wireless Controller on Linux This is a mapping when using evdev, not the more advanced HIDAPI support. (cherry picked from commit 206fa4dafb633ed074b930cbb3440a9925c532f2)
Sam Lantinga 3bf9c70a 2023-02-23T12:24:15 Changed the VID/PID used for the Backbone One controller on iOS (cherry picked from commit 516e48515e32f74aa98a3df4cbdb23b9c477f2f0)
Sam Lantinga ea710308 2023-02-23T11:57:48 Added support for the Backbone One PlayStation Edition (cherry picked from commit 59bf1c2853d5b06295c939099f6cf5f1611f70b5)
Sam Lantinga 13969f85 2023-02-21T15:31:32 De-duplicate Google Stadia controllers on macOS (cherry picked from commit 87a83787a3a0a9922b02b35ba809d9da86930fc8)
Sam Lantinga 9be85b84 2023-02-21T15:05:57 Rumbling the Google Stadia Controller over Bluetooth works on Linux and macOS (cherry picked from commit 4aeec9d8c2ad2fa0465999ecb4fd5c20734f1b27)
Sam Lantinga 35c9b104 2023-02-21T12:47:33 Fixed the packet size for Xbox One controllers (cherry picked from commit 021a7cfa13c20d518ebfb6e96c3305150256983b)
Sam Lantinga 31a57c05 2023-02-10T16:46:21 Fixed the share button on the ThrustMaster eSwap PRO Controller Xbox (cherry picked from commit e4face7c1d41698067b9afdd8c7f0a8f76774da2)
Sam Lantinga 3dff5d3c 2023-02-06T20:14:12 Added support for the Turtle Beach REACT-R and Recon Xbox controllers (cherry picked from commit 5fded632d6fa532ac25e76ad9a676c9ea726dd02)
Sam Lantinga 4c9a79dd 2023-02-20T18:24:52 Removed duplicated conditional (cherry picked from commit 1a15d506a69d5d73a53728c569ef84a69db51833)
Sam Lantinga 7c4f5e1d 2023-02-20T17:14:18 Fixed rumble caps for the Nintendo Joy-Con controllers (cherry picked from commit 02cea5fca107991774792c431efc96319ef2d060)
Sam Lantinga abe8dbbf 2023-02-20T15:14:20 Added support for the Razer Wolverine V2 controllers (cherry picked from commit 4994654d4f2d5c96a0faa972ebbb6c653f939d56)
Sam Lantinga f741adc8 2023-02-17T11:29:27 Added other names for the DragonRise Inc. Wired Wheel (thanks @felimwhiteley!) (cherry picked from commit eede2066fbcc342e96592fbbbfe94b2420feb524)
Sam Lantinga e86f4943 2023-02-16T09:50:04 Hold the joystick lock while opening the HID device on non-Android platforms On Windows the main thread can be enumerating DirectInput devices while the Windows.Gaming.Input thread is calling back with a new controller available, and in this case HIDAPI_IsDevicePresent() returned false since the controller initialization hadn't completed yet, creating a duplicate controller. Fixes https://github.com/libsdl-org/SDL/issues/7304 (cherry picked from commit ece8a7bb8e2dae9cb53115980cea9ef1213a0160)
Sam Lantinga 69b2baec 2023-02-14T18:02:12 Map the Android MENU button back to the SDL MENU key Thanks to @AntTheAlchemist for the investigation! Fixes https://github.com/libsdl-org/SDL/issues/7318 (cherry picked from commit beb6a2afdc74a00f07ec230297c2675920a7bf79)
Sam Lantinga 2c699577 2023-02-14T17:51:16 Fixed handling simple mode PS4 reports Fixes https://github.com/libsdl-org/SDL/issues/7270 (cherry picked from commit 5925cd4ef377a2211fd057ef6fa9f41141999cb7)
Sam Lantinga 7285f0d4 2023-02-10T17:18:02 Sorted controller list (cherry picked from commit 68e2f230662a0b3f2ce7c0085f781f1652901af3)
Alfredo Escobar ca3468cb 2023-01-30T16:08:52 Add Hori Pokken Tournament DX Pro Pad (cherry picked from commit 76552e4780a57f24ec1cd77fb942b7cabe1219d8)
Sylvain 17515f4a 2023-02-04T15:51:37 Backport simplify flags PR #7220
Sam Lantinga d77eb8a8 2023-02-08T14:22:39 Make sure we synchronously re-enable USB reporting mode for Switch controllers (thanks @SortaCore!) Fixes https://github.com/libsdl-org/SDL/issues/3450 (cherry picked from commit b7c6fec10a152e47f8fa18350134188b75e9df0b)
Sam Lantinga 3fb9118c 2023-02-08T14:16:24 Note the Google Stadia controller doesn't support rumble over Bluetooth (cherry picked from commit 50575ed2233b9924198e10c9a261c10323d9089e)
Sam Lantinga 71fb4e3d 2023-02-08T14:16:21 Fixed mis-detecting the share button on the Xbox controller over NDIS (cherry picked from commit 00e02de77b615d5faf94af709760fd0f2e749a39)
Sam Lantinga 2518e32d 2023-02-08T14:16:17 Dynamically update the serial number if it isn't available at first This happens for Xbox One controllers using newer firmware connected over NDIS (cherry picked from commit d1c72bb0bc54fba41ba89930a3ed98f8767be724)
Sam Lantinga e8938fc6 2023-01-20T09:31:22 Enable paddles on the Xbox Elite controller when connected over USB (cherry picked from commit c4db0725e4cf5eb6ec5239e6f03346958e88b9cf)
Ozkan Sezer fde63236 2023-02-07T01:11:02 fix build after the Logitech ChillStream patch.
Sam Lantinga 71546059 2023-02-06T13:28:00 Added support for the Logitech ChillStream (cherry picked from commit 6f7edaf8920c504ebd3e797bd04ec1d2e46c4aa9)
Sam Lantinga 5b5a72e3 2023-02-05T08:43:26 Sorted controller list (cherry picked from commit 1c03ddefc320ec9969d5f81c2c3cb988d94a8b4c)
Antonis Geralis 58fa43e7 2023-02-05T10:35:53 Added Elecom 8button gamepad (cherry picked from commit 52cd9fcbb074771804f443e7a9b2e9436485fe83)
Leonardo Brondani Schenkel 4266cf85 2023-01-04T13:46:01 Add Linux mapping for 8BitDo Pro 2 Wired Controller for Xbox Without these mappings, this controller "kinda" works out of the box: - `SDL_GameControllerMapping()` works because it will notice "Xbox" in the name and use the default XInput mappings - `SDL_GameControllerMappingForGUID()` will not find any mapping lsusb: ``` ID 2dc8:2000 8BitDo 8BitDo Pro 2 Wired Controller for Xbox ``` In Linux this controller is supported by two drivers: - `xpad` (built-in to the kernel), exposes the controller name from the USB descriptor and the GUID starts with 03 (0x03 = BUS_USB) - `xone` (https://github.com/medusalix/xone), exposes a virtual controller which is always named "Microsoft X-Box One pad" and the GUID starts with 06 (0x06 = BUS_VIRTUAL) This commit adds the 2 GUIDs from both drivers so mappings will always be found and the real controller name will always be reported.
Alynne 92779a5b 2023-01-30T01:46:03 Adds Stadia BT mapping (cherry picked from commit 4dea13e02fbfd2ac9eeb0a5cbb35cf5d1d53f549)
Sam Lantinga c4a493de 2023-02-02T08:39:54 Don't accept official mappings for controllers that aren't unique For example, the DragonRise Inc. Generic USB Joystick See https://github.com/gabomdq/SDL_GameControllerDB/issues/202 for details (cherry picked from commit 673bc5764942e3f645f1ff7d64f3d6a2059e3cdb)
Sam Lantinga 4a87abc9 2023-02-02T08:38:22 Fixed sort_controllers.py and resorted game controller database (cherry picked from commit 917607c335a87edcb3870b8504247609bea3c04d)
Sam Lantinga 2290d713 2023-02-01T23:09:53 Added gamepad mappings for the Xin-Mo Dual Arcade Fightstick (cherry picked from commit d29e1f363239b45aedf5f81683fbb6cf52029bc2)
happyharryh 2cb42236 2023-01-10T20:36:13 Fixed the hat_map to avoid segmentation fault (cherry picked from commit 57e78f4cf53b0fc84900a047120263c3c71e721c)
Narr the Reg fa934dd4 2023-01-09T17:42:17 hidapi: switch: Add user calibration support (cherry picked from commit 9fa55d9cabc93532cd5cf44105ec589a4db1d097)
Sam Lantinga 0479df53 2023-01-09T09:48:21 Updated copyright for 2023
Sam Lantinga ebc2fb41 2023-01-08T09:32:31 Fixed infinite loop shutting down WGI controllers We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list. Fixes https://github.com/libsdl-org/SDL/issues/7016 (cherry picked from commit ac99db9fc8d528a79abb98a5641e0fd94aa20a9e)
Sam Lantinga 988866ca 2023-01-03T15:12:47 Fixed line wrapping for HID packet dump (cherry picked from commit e85839cd5694a79f69ac16f48a5d845cdc62f809)
Sam Lantinga 2cb7a0a0 2023-01-03T15:12:18 Added support for the ThrustMaster eSwap PRO Controller Xbox (cherry picked from commit dacdb1c310d97ca3c3e6492cae0611f86b281b34)
Sam Lantinga 29a4c5eb 2022-12-28T12:51:36 Fixed getting the VID/PID of a virtual joystick (cherry picked from commit e40a96155fc488feaeeeb79f947eb43399faa481)
Sam Lantinga 903df79b 2022-12-27T12:14:43 Make sure we match the same way when adding a mapping and looking up a mapping Fixes https://github.com/libsdl-org/SDL/issues/6898 (cherry picked from commit 3db9112ef4cbb936b11f941f8a98c1704e37e140)
Sam Lantinga 6969b3be 2022-12-19T09:14:04 Don't send Razer devices the Sony third-party query feature report Some of them lock up or reset, and the vast majority of devices are not actually game controllers. Fixes https://github.com/libsdl-org/SDL/issues/6733 (cherry picked from commit 83b29f9ce1fe6caa06769544c3b5f6c10ea97a0f)
Sam Lantinga 3b0cd441 2022-12-17T06:51:02 Fixed compiler warning ``` ./src/joystick/SDL_joystick.c:105:12: warning: no previous extern declaration for non-static variable 'SDL_joystick_lock' [-Wmissing-variable-declarations] SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */ ^ ./src/joystick/SDL_joystick.c:105:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */ ^ ``` 1 warning generated.
Sam Lantinga a53382e4 2022-12-15T18:00:51 Sorted PS4 controllers, note that the NACON Wireless Controller for PS4 actually reports as an XInput device
Sam Lantinga e99b9ca9 2022-12-15T17:58:29 Note that the NACON Daija Arcade Stick is an arcade stick
Sam Lantinga 7a9966af 2022-12-14T14:24:58 Fixed crash in SDL_PrivateGameControllerRefreshMapping()
Sam Lantinga d59caffe 2022-12-13T14:03:40 Added support for clang thread-safety analysis The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code. Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change. This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock. To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
Sam Lantinga 817454cf 2022-12-12T18:00:57 Don't try to open the Razer Huntsman Elite keyboard as a controller
Sam Lantinga 802b5ef7 2022-12-12T10:54:29 Added support for the STRIKEPAD PS4 Grip Add-on to the HIDAPI driver (cherry picked from commit 618340bf990512247ed29a1beb38606e371d60e8)
Sam Lantinga fc689a6c 2022-12-07T16:06:17 Fixed build
Sam Lantinga b4d54790 2022-12-07T14:53:33 Use the correct name for the DualSense controllers (cherry picked from commit 9a6bcca6b8db999217f157dab8c44bf27b0a8eb4)
Sam Lantinga 4ee36a94 2022-12-07T14:25:53 Added support for the DualSense Edge paddles (cherry picked from commit 9339085593dc20b1f003f26b3c40615cf04504b0)
Sam Lantinga d1b48105 2022-12-05T13:36:51 Fixed centering the D-pad on some joysticks Fixes https://github.com/libsdl-org/SDL/issues/6767
Max Bachmann 7ac66972 2022-12-03T09:45:04 Detect Logitech PRO Racing Wheel as wheel (cherry picked from commit 5650046f931e9b1d7d7f4a1867e6e1ed75a5e7c5)
Sam Lantinga 423c558e 2022-12-01T14:43:34 Detect the G923 (Xbox style) and PXN V900 (PS3 mode) as wheels (cherry picked from commit 7237c5649994d2b2c2b364c3b116a6db80ea671d)
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sylvain 09ee811f 2022-12-01T09:39:08 Small format changed (using clang-format 15.0.2-1) (cherry picked from commit 778b8926b4808f0642a331ed84a9e8e19899b6db)
Sam Lantinga 6e40c7a9 2022-11-30T17:03:29 Added support for the Logitech Cordless Precision PS3 controller
Sam Lantinga 01541bc3 2022-11-30T16:42:00 Added support for the HORIPAD Pro for Xbox Series X
Sam Lantinga 4504c10f 2022-11-30T16:37:20 Re-enabled support for third party PS3 controllers
Sam Lantinga 9e997cc7 2022-11-30T15:39:10 Fixed Victrix FS Pro V2 controller hang on reboot
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sam Lantinga 2d24baaa 2022-11-29T09:26:29 Fixed building on Windows with SDL_VIDEO=OFF Fixes https://github.com/libsdl-org/SDL/issues/6562
Sam Lantinga 89e9f7b4 2022-11-28T23:10:02 Added support for the Xbox Elite controller paddles with firmware version 5.13+
Vasily Khoruzhick b6c875a9 2022-11-28T17:01:16 Add support for the 8BitDo Ultimate Wireless 2.4GHz Controller in DirectInput mode Generated using controller map
Sam Lantinga 37d244ea 2022-11-28T14:48:32 Added support for the 8BitDo Ultimate Wired Controller in DirectInput mode, including the misc button and paddles
Sam Lantinga a937b5c4 2022-11-28T13:47:30 Add 8BitDo to the list of Xbox 360 third party vendors Allows detection of the 8BitDo Ultimate Wired Controller
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)