src/joystick


Log

Author Commit Date CI Message
Sam Lantinga e5e54169 2020-02-07T20:19:32 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. Specifically the Razer DeathAdder 2013 has this VID/PID
Sam Lantinga 833f76ab 2020-02-07T11:49:56 Fixed bug 4968 - NULL passed to memcpy in WriteProprietary in SDL_hidapi_switch.c meyraud705 In SDL_hidapi_switch.c line 443: Function BTrySetupUSB call WriteProprietary with pBuf=NULL and ucLen=0 line 376: WriteProprietary check its input (!pBuf && ucLen > 0) || ucLen > sizeof(packet.rgucProprietaryData): ucLen is 0 so it passes line 382: WriteProprietary call memcpy with pBuf=NULL
Sam Lantinga 8ba77b35 2020-02-07T11:44:57 Use the asynchronous HIDAPI rumble code for Nintendo Switch Pro controllers
Sam Lantinga 81256207 2020-02-07T11:02:34 Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms meyraud705 Dualshock4 on bluetooth need 78 bytes for the rumble data while SDL_HIDAPI_RumbleRequest can only hold 64 bytes. 'volatile' is not meant for thread synchronization. The list of rumble request could grow infinitely if user call SDL_JoystickRumble too much. The documentation says "Each call to this function cancels any previous rumble effect", so overwriting pending request seem like a good idea.
David Ludwig d88f3f52 2020-02-05T13:16:17 macOS: fix crash if and when joystick-init-on-add fails
Sam Lantinga a199cb89 2020-02-05T09:29:46 Updated the Android Xbox One Wireless Controller mapping for the latest Xbox controller firmware update
Sam Lantinga dc1d3c29 2020-02-04T18:36:23 Catch both PS3 and PS4 motion controls and don't treat them as a game controller
Sam Lantinga 1d1a35ef 2020-02-04T16:05:39 Fixed Visual Studio build
Sam Lantinga 1bd12026 2020-02-04T15:42:49 Added SDL_hidapi_rumble.c to the macOS, iOS and tvOS builds
Sam Lantinga 02108cf7 2020-02-04T15:27:25 Added missing files from previous commit
Sam Lantinga 1684606f 2020-02-04T15:26:56 Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers There is now a thread that handles all HIDAPI rumble requests and a lock that guarantees that we're not reading and writing the device at the same time.
Sam Lantinga 6efebf17 2020-02-04T12:48:53 Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests.
Sjoerd Simons 976eee77 2020-02-04T07:23:44 Correct joystick hat indexes on linux The index and indices were swapped; Which is fine as long as there are no gaps in the ABS_HAT* event availability but otherwise things do get confused. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Sam Lantinga 212609b3 2020-01-31T14:09:23 Map the right pad on the Steam Controller to the right stick in the game controller API
Sam Lantinga 39a498c9 2020-01-31T13:09:20 Build the hidapi framework and weak link it on Mac OS X
Sam Lantinga 91121ee4 2020-01-31T10:45:04 Weak link the hidapi framework on iOS and tvOS
David Ludwig 65fd6336 2020-01-30T18:03:34 FIX for SDL-4927: CFRetain+CFRelease a game controller's IOKit object This fixes a crash whereby SDL could crash on macOS/Darwin, if and when a USB game controller gets unplugged. SDL was not retaining a reference to the controller's OS/IOKit-provided 'device object', and was capable of trying to use it, after a device was hot-unplugged.
Sam Lantinga 0641711e 2020-01-29T20:09:59 Added missing file from previous commit
Sam Lantinga 355f0b54 2020-01-29T20:09:11 Added support for the Steam Controller on mobile devices
Sam Lantinga c9c89783 2020-01-29T20:09:08 Miscellaneous pending fixes
Sam Lantinga 43b377b0 2020-01-28T17:11:17 Fixed wired PS4 controller support on Android
Ryan C. Gordon 059de38c 2020-01-27T15:44:48 darwin: Don't pass NULL device refs to IOHIDDeviceGetValue(). Possibly fixes Bugzilla #4961.
Sam Lantinga 7ea3f5b4 2020-01-26T12:48:35 Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble meyraud705 Switch hidapi and xinput also need to check for overflow, attached a patch for them.
Sam Lantinga adb53d0b 2020-01-26T10:32:39 Fixed disabling the Xbox 360 wireless HIDAPI driver
Sam Lantinga c9f672fd 2020-01-23T22:24:24 Fixed compiler warnings
Sam Lantinga 2ae41b9c 2020-01-23T12:53:43 Fixed mapping for both versions of the Xbox One Elite Series 2 controller firmware connecting over Bluetooth
Sam Lantinga 48240ac8 2020-01-23T12:53:41 Added mapping for the Xbox One controller connected via the wireless dongle using xow
Sam Lantinga 6dc172d0 2020-01-23T12:53:39 Turn off rumble on drivers which don't respect the replay.length value
Sam Lantinga 443bce74 2020-01-22T11:28:35 Added support for the paddles on the Xbox One Elite Series 1 controller
Sam Lantinga 25c88ea9 2020-01-20T13:53:40 The Xbox One 0x01 initialization packet is an ack packet
Sam Lantinga 9c3d1602 2020-01-19T11:43:36 Refactored code so SDL_GetJoystickGameControllerType() is called less during controller detection
Sam Lantinga ff068011 2020-01-18T11:21:42 Added missing file from previous commit
Sam Lantinga 43aa1fa9 2020-01-18T11:21:14 Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android
Sam Lantinga 27035425 2020-01-17T11:09:57 There are multiple bindings for XBox One controller model 1708, depending on firmware revision
Sam Lantinga bde1a371 2020-01-17T11:07:19 Added support for the NACON GC-400ES
Sam Lantinga 4e682461 2020-01-17T10:43:14 Reattach the kernel driver after closing USB controllers
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga c6817a2c 2020-01-16T15:32:41 Added support for the paddles on the Xbox One Elite Series 2 controller
Sam Lantinga 4e1cc124 2020-01-16T15:32:39 Improved Xbox One controller initialization
Sam Lantinga 669729a8 2020-01-15T22:18:31 Improved Xbox One controller initialization sequence This sequence works across Microsoft, PowerA, PDP, and HORI controllers. The newer Microsoft XBox firmware requires synchronizing the rumble sequence number, when SDL sees it after the initial connect The Razer Wildcat controller requires waiting for init responses before continuing the initialization sequence. The PDP Battlefield 1 controller takes over a second to be ready for initialization, and if initialization is attempted before then, it will fail.
Sam Lantinga 34486005 2020-01-15T22:18:29 Added support for the HORI Fighting Commander
Sam Lantinga 6705e27c 2020-01-13T22:05:58 Added D-PAD bindings for the Linux Steam Controller
Sam Lantinga cb800d1c 2020-01-13T22:05:56 Fixed compiler warning
Sam Lantinga 7775f7ce 2020-01-13T22:05:54 Fixed deadlock in HIDAPI joystick system
Sam Lantinga 3a796d6a 2020-01-13T15:35:54 Free the joystick player index when the joystick is removed
Sam Lantinga d2cda502 2020-01-12T17:22:24 Send the full Xbox One controller sequence for Microsoft controllers This switches Bluetooth controllers back into USB report mode for the latest Xbox One S and Xbox One Elite Series 2 firmware
Sam Lantinga c14a59d9 2020-01-11T13:38:50 Worked around an issue where the kernel would lose the force feedback effect
Sam Lantinga d33b122f 2020-01-11T04:34:28 The Xbox One S Bluetooth controller with older firmware uses b16 as the guide button. The same controller with newer firmware uses b12 as the guide button. Map both buttons so both firmware revisions will work with the same mapping.
Sam Lantinga 5d28c315 2020-01-09T14:53:34 Only initialize Xbox One controllers once they're ready for initialization (or if they are silent until init) This fixes the Hyperkin Duke Xbox One controller showing the Xbox startup animation every time an SDL application launches
Sam Lantinga 47abe4e3 2020-01-09T14:53:30 Fixed crash when unplugging a HIDAPI controller
Sam Lantinga f34795d0 2020-01-08T18:55:53 Added support for the updated Hyperkin Duke Xbox One controller
Sam Lantinga f4375e86 2020-01-07T18:43:40 Added support for the 8BitDo M30 GamePad
Sam Lantinga a56aaea1 2020-01-07T16:47:56 Fixed handling the 8BitDo M30 in Nintendo Switch mode
Sam Lantinga eb3d39bc 2020-01-06T12:18:51 Added support for the 8Bitdo FC30 Pro
Sam Lantinga d9c4be06 2020-01-01T08:13:40 Added support for the Hyperkin Duke controller
Sam Lantinga 4c9628a0 2019-12-30T17:56:56 Fixed GameCube controller axis and trigger ranges and X and B button being swapped
Sam Lantinga 8b0660b2 2019-12-30T13:18:57 Fixed bug 4918 - SDL failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows LinGao We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows on latest default branch. And we found that it can be first reproduced on 0fff06175109 changeset. Could you please help have a look about this issue? Thanks in advance! Steps to Reproduce: 1.hg clone https://hg.libsdl.org/SDL D:\SDL\src 2.Open a VS 2017 x64 command prompt as admin and browse to D:\SDL 3.msbuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 VisualC\SDL.sln /t:Rebuild Actual result: Creating library D:\SDL\src\VisualC\x64\Release\SDL2.lib and object D:\SDL\src\VisualC\x64\Release\SDL2.exp SDL_joystick.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex [D:\SDL\src\VisualC\SDL\SDL.vcxproj] D:\SDL\src\VisualC\x64\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals [D:\SDL\src\VisualC\SDL\SDL.vcxproj] Done Building Project "D:\SDL\src\VisualC\SDL\SDL.vcxproj" (Rebuild target(s)) -- FAILED.
Sam Lantinga a9482a1d 2019-12-30T09:44:32 Added support for the Nintendo GameCube adapter, tested on Steam Link hardware
Zack Middleton f0cee3ed 2019-12-22T13:15:11 Fix shutting down HIDAPI device with multiple joysticks Using Wii U GameCube USB adapter with multiple controllers attached and restarting SDL input in a game results in extra joysticks with NULL name. HIDAPI_CleanupDeviceDriver() shut down joysticks by iterating through device->num_joysticks but each HIDAPI_JoystickDisconnected() decreases device->num_joysticks and shifts joysticks array down. Resulting in only half of controllers being shutdown. It worked with only 1 controller attached though. Disconnect HIDAPI device joystick 0 until there are none left.
Sam Lantinga d000a592 2019-12-21T22:33:21 Fixed windows build
Sam Lantinga f3a547d0 2019-12-20T21:40:28 Added support for the Hori Dragon Quest Slime Controller
Sam Lantinga 46e1377d 2019-12-20T20:12:03 Automatically assign player indexes to game controllers, and allow changing the player index for game controllers and joysticks. Added the functions SDL_JoystickFromPlayerIndex(), SDL_JoystickSetPlayerIndex(), SDL_GameControllerFromPlayerIndex(), and SDL_GameControllerSetPlayerIndex()
Sam Lantinga 6b767872 2019-12-19T21:45:44 Make sure the Xbox 360 driver doesn't try to talk to the wireless controllers
Sam Lantinga 1db56619 2019-12-19T18:03:28 Fixed rare infinite rumble in HIDAPI controller driver
Sam Lantinga 25bd5070 2019-12-19T18:00:08 Fixed GameCube rumble
Sam Lantinga 202c966a 2019-12-19T16:14:22 Added support for the Nintendo GameCube Controller, using the Mayflash GameCube adapter.
Sam Lantinga 2481ab93 2019-12-19T15:58:16 Fixed compiler warning
Sam Lantinga 20daf54f 2019-12-19T15:18:50 Added new HIDAPI driver files to the Xcode projects
Sam Lantinga fead0b24 2019-12-19T15:02:12 Added missing files from previous commits
Sam Lantinga e22e77da 2019-12-19T15:01:35 Added an untested driver for the Nintendo GameCube adapter, based on code contributed by Ethan Lee
Sam Lantinga 15d30298 2019-12-19T15:01:32 Added support for wireless Xbox 360 controllers using the HIDAPI driver
Sam Lantinga e7f7e3f4 2019-12-19T15:01:30 Refactored HIDAPI controller code to support dongles and hubs that dynamically attach controllers
Sam Lantinga 52b6ab21 2019-12-16T17:11:23 Added support for the SteelSeries Stratus Duo
Sam Lantinga a7ae9175 2019-12-16T10:20:03 Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble meyraud705 On a Dualshock 4 controller using hidapi driver, calling SDL_JoystickRumble with a duration too long (SDL_HAPTIC_INFINITY for example) causes the rumble to stop immediately. This happens because of integer overflow on line 301 of SDL_hidapi_ps4.c (https://hg.libsdl.org/SDL/file/a3077169ad23/src/joystick/hidapi/SDL_hidapi_ps4.c#l301), which sets expiration time in the past.
Sam Lantinga 9f8009f2 2019-12-13T16:12:41 Added mappings for the Razer Serval on Windows and Mac OSX
Sam Lantinga cf9af481 2019-12-13T16:12:39 Added support for the 8Bitdo NES30 GamePad in wired mode
Sam Lantinga c2b6d6f9 2019-12-13T16:12:37 Enable the LED on PowerA Xbox One controllers
Sam Lantinga 511df4a5 2019-12-13T16:12:35 Added support for the BDA XB1 Spectra Pro
Sam Lantinga 55f8eabf 2019-12-13T16:12:33 Identified the BDA XB1 Classic Controller
Sam Lantinga 0352814a 2019-12-13T16:07:25 Added general remapping of controller manufacturer
Sam Lantinga b51d7f35 2019-12-13T16:07:22 Added support for the HORI PAD A
Sam Lantinga 23c39a2e 2019-12-12T19:14:37 Strip trailing whitespace on controller manufacturer identification
Sam Lantinga 4d4e5584 2019-12-12T19:07:26 Fixed binding D-pad on NES30 controller
Sam Lantinga 1ac7eaba 2019-12-12T14:25:02 Fixed comment typo
Sam Lantinga a613fc7c 2019-12-11T19:24:40 Added names for official Microsoft controllers, since they don't have descriptive product names
Sam Lantinga 0f529160 2019-12-11T17:47:01 Added custom names for some controllers
Sam Lantinga e029fdbb 2019-12-11T17:46:59 Shorten "Performance Designed Products" to "PDP"
Sam Lantinga 325a2efb 2019-12-11T17:46:57 Added support for the full line of PDP Xbox 360 and Xbox One controllers
Sam Lantinga 8b50dcb2 2019-12-11T17:46:54 Use the controller product string instead of hard-coding controller names
Sam Lantinga 89401b21 2019-12-10T13:09:52 Added support for the Razer Raion Fightpad for PS4
Sam Lantinga a21f6b7a 2019-12-10T11:46:22 Add the manufacturer to the joystick name on Mac OS X, for consistency with other drivers
Sam Lantinga 2a161e7a 2019-12-10T11:30:56 Remove any duplicate manufacturer in the joystick name
Sam Lantinga 3469481e 2019-12-10T10:00:49 Don't include the manufacturer if it's already included in the product string
Sam Lantinga bb37a1eb 2019-12-10T09:38:10 Fixed the name of the Razer RAION Fightpad
Sam Lantinga 82d2c357 2019-12-09T16:52:11 Fixed rumble after Xbox controller initialization When we initialize the controller it has an internal rumble sequence number, and if our rumble sequence number doesn't match that, rumble won't happen. To fix that we cycle through the range of sequence numbers, and at some point we'll match up with the controller's sequence number and it'll roll forward until it matches our next rumble sequence number.
Sam Lantinga 3d34750c 2019-12-09T13:54:05 The PowerA Mini controller blocks while writing feature reports, so don't try to use the HIDAPI driver for it on Linux
Sam Lantinga 36265063 2019-12-09T13:54:03 Added some missing Xbox controller names
Sam Lantinga 135a9053 2019-12-06T13:48:13 Fixed the Apple TV remote menu button on tvOS 13.2 (thanks Romain Tisserand)
Sam Lantinga 7a51ad6a 2019-12-06T13:48:10 Fixed the game controller menu button on tvOS 13.2 (thanks Romain Tisserand)
Sam Lantinga 8342fa7c 2019-12-05T13:48:08 Fixed controller mapping issues caused by PS3 gyro jitter