src/joystick/hidapi


Log

Author Commit Date CI Message
Sam Lantinga e49321ce 2022-08-10T08:20:54 Fixed double-free in combined HIDAPI controller code
Sam Lantinga 9ff498e7 2022-08-10T06:00:30 Make HIDAPI_JoystickOpen() more robust against internal logic errors Fixes https://github.com/libsdl-org/SDL/issues/6030
Sam Lantinga 8e782876 2022-08-09T21:30:11 Fixed spamming the controller with reset IMU commands when they are failing
Sam Lantinga eab27b90 2022-08-09T17:58:42 Make sure Switch controller initialization is synchronous and start the input timeout then
Sam Lantinga 1db7d33d 2022-08-09T17:04:26 Recover from Bluetooth devices temporarily out of range
Sam Lantinga 6d012b2a 2022-08-09T16:54:11 Better fix for rescanning devices after read failure
Sam Lantinga 483a010f 2022-08-09T15:39:39 Fixed accidentally deadlocking the rumble thread with combined Joy-Cons Also added more accurate check for sensor data. At least one axis will always have acceleration because of gravity.
Sam Lantinga 5d63a3d4 2022-08-09T14:06:49 Re-enumerate devices if a read fails This allows combined Joy-Con devices to immediately separate if one of them is disconnected
Sam Lantinga da50f1bd 2022-08-09T14:05:43 Bluetooth devices can recover from over a second of dropped reports
Sam Lantinga 824f2d46 2022-08-09T13:41:58 Added a second hint SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED to control the Home button LED on Nintendo Joy-Con controllers separately from Nintendo Switch Pro controllers
Sam Lantinga 8aa6922f 2022-08-09T13:25:52 Fixed detecting Bluetooth disconnection on Nintendo Switch controllers
Sam Lantinga 201484ff 2022-08-09T09:03:28 Don't duplicate the serial number twice if a child doesn't set one
Sam Lantinga d90c0d41 2022-08-09T09:00:29 Include the child serial numbers in the serial number for a HIDAPI combined device
Sam Lantinga df537a7c 2022-08-09T00:18:19 SDL_GameControllerSetPlayerIndex(gamecontroller, -1) means turn off the player LED if possible
Sam Lantinga 5545be85 2022-08-08T23:44:50 The player LED index wraps for PS5 controllers, like it does for other controller types
Sam Lantinga 6204ae50 2022-08-08T20:09:49 Restart the IMU if the controller stops sending gyro/accel data
Sam Lantinga d58bec72 2022-08-08T17:19:12 Fixed Joy-Con gyro axes in mini-gamepad mode
Sam Lantinga 47ebf008 2022-08-08T08:35:56 Fixed shadow variable warning
Sam Lantinga 87825972 2022-08-08T08:22:20 Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers
Sam Lantinga 52bf5b1d 2022-08-06T10:34:19 Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED is set on Nintendo Switch controllers
Sam Lantinga 4a9ceb7b 2022-08-04T11:33:36 The HORIPAD S uses the Xbox 360 protocol on all platforms and shows up as multiple styles of controller, depending on what model you have.
Sam Lantinga 28c01955 2022-08-04T10:46:37 Fixed button mapping for the HORIPAD S This controller actually comes in at least two flavors: a GameCube controller and an arcade pad, neither of which should have the face buttons remapped.
Sam Lantinga 43b90484 2022-08-04T00:40:38 Retry a little longer when writing to the Nintendo Joy-Con Charging Grip
Sam Lantinga dfd2c574 2022-08-03T22:27:43 Removed unused variable
Sam Lantinga c84dea09 2022-08-03T22:12:21 Fixed detecting the controller type of controllers over USB
Sam Lantinga ba297f12 2022-08-03T21:46:01 Use the Nintendo controller type to determine whether to always use button labels
Sam Lantinga 946f4777 2022-08-03T21:33:38 Don't set Bluetooth controllers to wired power level
Sam Lantinga 57c3b2c9 2022-08-03T21:31:12 Don't rely on the device VID/PID to get the Nintendo controller type The Nintendo Online Sega Genesis controller reports the SNES VID/PID over Bluetooth. This is a more robust way of handling future controllers as well, so let's go with this instead. Also use full reports over Bluetooth, and don't report gyro for Nintendo Online classic controllers.
Sam Lantinga b6aadb16 2022-08-03T20:38:33 Added k_eSwitchDeviceInfoControllerType_N64 to ESwitchDeviceInfoControllerType
Sam Lantinga bdfb32de 2022-08-03T20:30:58 Added some additional Nintendo controller types to ESwitchDeviceInfoControllerType
Sam Lantinga 5d50fa52 2022-08-03T19:39:36 Fixed timeout opening the Nintendo Joy-Con Charging Grip Sometimes opening the right Joy-Con takes a little longer for some reason
Sam Lantinga 29cdb2c9 2022-08-03T18:01:10 Added support for the Nintendo Switch Joy-Con Charging Grip
Sam Lantinga a8120104 2022-08-03T13:53:49 The Nintendo Online classic controllers and Joy-Cons shouldn't show up as Switch Pro controllers
Sam Lantinga 8ab9dc8b 2022-08-03T13:18:00 Fixed crash if Joy-Cons are disabled while a combined Joy-Cons controller is open
Sam Lantinga bcdef4aa 2022-08-03T13:07:47 Added separate hints for Nintendo Online classic controllers and Joy-Cons This allows them to be enabled/disabled separately from Switch Pro HIDAPI support
Mathieu Eyraud 59a104b8 2022-08-02T15:00:55 Do not pass NULL to memcpy ReadJoyConControllerType calls WriteSubcommandSync with pbuf=NULL
Mathieu Eyraud 42b23207 2022-08-02T14:42:25 Fix memory leak of children for combined JoyCon
Sam Lantinga aee179e4 2022-07-28T21:50:20 Removed debug output
Sam Lantinga 875b737c 2022-07-28T21:39:32 Added support for the Nintendo Online NES Controllers to the HIDAPI driver
Sam Lantinga ab967475 2022-07-28T19:38:38 Greatly improved Nintendo Joy-Con support using the HIDAPI driver * Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16 * Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller * Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality * Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
Sam Lantinga dfed862a 2022-07-28T19:35:46 Fixed variable shadow warning
Sam Lantinga 2fa2f9ff 2022-07-28T19:22:27 Greatly improved Nintendo Joy-Con support using the HIDAPI driver * Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16 * Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller * Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality * Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
Sam Lantinga def60ce6 2022-07-27T19:20:42 Fixed the name of the HIDAPI Joy-Con controller for consistency with other drivers
Sam Lantinga a169259f 2022-07-27T09:05:02 Actually we don't need to unlock to send k_eSwitchProprietaryCommandIDs_ForceUSB since we don't wait for reply
Sam Lantinga c51464d9 2022-07-27T09:00:39 Put the Nintendo Switch Pro controller back into enhanced mode as needed Fixes https://github.com/libsdl-org/SDL/issues/3450
Sam Lantinga a423848e 2022-07-25T11:26:18 Allow floating point values for SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED This allows setting the brightness of the home LED on Nintendo Switch Pro controllers, in the range 0.0 - 1.0. This can be updated at runtime by setting the hint dynamically. Fixes https://github.com/libsdl-org/SDL/issues/3787
Cameron Gutman 3ab1e303 2022-07-24T15:29:42 joystick: Refactor and fix a few bugs in Shield HIDAPI driver - CMD_CHARGE_STATE was checking the seqnum instead of the payload - Off-by-one error in size validation for command payload - Unused payload space was left uninitialized in output report
Sam Lantinga be3a945a 2022-07-20T11:05:55 Added support for the 8BitDo Ultimate Wired Controller for Xbox
Sam Lantinga e24b971a 2022-07-12T17:53:03 Added support for the NVIDIA Shield controller guide button
Cameron Gutman b321eae5 2022-07-11T19:43:25 joystick: Fix spurious battery empty events when opening a Shield controller
Cameron Gutman a0d8848b 2022-07-11T19:37:25 joystick: Plumb SDL_JoystickSendEffect() for the Shield HIDAPI driver The effect data format consists of one command byte followed by zero or more payload bytes.
Cameron Gutman 6e712d24 2022-07-09T22:55:36 joystick: Add HIDAPI driver for NVIDIA SHIELD 2017 controller Basic input already works using the OS HID driver, but this enables force feedback and battery state reporting.
Cameron Gutman 3242265f 2022-07-10T12:22:47 joystick: Fix endianness issues in Xbox HIDAPI drivers
Cameron Gutman 3e114872 2022-06-30T20:36:45 joystick: Fix redetection of HIDAPI joysticks after reinitializing The HIDAPI joystick driver doesn't properly reset the change counter it uses to track if re-enumeration is needed when the joystick subsystem is quit and then reinitialized. The first SDL_Init(SDL_INIT_JOYSTICK) will result in the expected HIDAPI joysticks appearing, but subsequent calls will result in no joysticks being enumerated until another HIDAPI joystick is added or removed from the system.
chalonverse 3b191580 2022-06-27T17:19:39 Windows GDK Support (#5830) * Added GDK * Simplfied checks in SDL_config_wingdk.h * Added testgdk sample * Added GDK readme * Fixed error in merge of SDL_windows.h * Additional GDK fixes * OpenWatcom should not export _SDL_GDKGetTaskQueue * Formatting fixes * Moved initialization code into SDL_GDKRunApp
Sam Lantinga b0e827fb 2022-06-17T07:55:33 Enable improved rumble emulation on DualSense(tm) Wireless Controllers with firmware version 2.24 and newer
Sam Lantinga 16f55fbd 2022-06-15T20:44:43 Separate the controller protocol from the controller style This allows us to handle controllers that use the Xbox protocol but look like Nintendo Switch or Playstation controllers, like the Qanba Dragon Arcade Stick in PC mode
Sam Lantinga 68544be4 2022-06-10T11:31:59 Added support for the Nintendo Online controllers
Sam Lantinga 9202df04 2022-06-09T18:11:34 Implemented SDL_GameControllerGetFirmwareVersion() for HIDAPI PS5 controllers
Sam Lantinga b1cf3229 2022-05-19T16:49:47 Fixed HIDAPI PS4 controller being picked up when running under Steam Input with PS4 configuration enabled
Cameron Cawley 0cca71a8 2022-05-18T22:12:05 Use SDLCALL for callbacks in public APIs
Sam Lantinga e551384a 2022-04-26T14:54:14 Added functions to get the platform dependent name for a joystick or game controller
Jibb Smart d7c07d6b 2022-04-27T00:57:17 Read motion sensor scale from Switch controllers (#5555) * Read IMU scale data from Switch controllers. Up until now, SDL has used hard-coded scaling which isn't correct with some supported controllers. * Moved declarations to beginning of code blocks to better fit with SDL style requirements
meyraud705 0964c84d 2022-02-02T11:21:32 Always use SDL_PrivateJoystickBatteryLevel to update battery level But do not use it for initialisation.
Sam Lantinga 2ca08378 2022-04-22T14:21:41 SDL: sometimes the PS5 controller doesn't report having to power even when connected over USB. Possibly related to being completely charged? Either way we already know that it's USB or BT so let's use the driver's knowledge instead.
Cameron Gutman 2c04df8d 2022-03-30T18:33:38 joystick: Fix rumble issues on PS5 HIDAPI controllers We were returning the report size from HIDAPI_DriverPS5_RumbleJoystick() rather than 0 upon success, causing SDL_JoystickRumble() (and callers) to think that rumbling failed. This didn't cause major problems until 1868c5b, when it started preventing rumble state from being persisted in the joystick core, even though it was successfully sent to the hardware. This led to all sorts of strangeness, including broken rumble duration and attempts to stop rumble being discarded.
Ryan C. Gordon 4fe7b2cb 2022-03-24T11:00:43 static analysis: Fixed several complaints from codechecker. There are still some pending Objective-C specific issues. Reference issue #4600.
Phillip Stephens 94d43186 2022-02-22T00:41:15 GameCubeAdapter: Add suppport for all rumble modes This adds support for all 3 of the gamecube controller's rumble modes Rumble: 1 Stop: 0 StopHard: 2 This is useful for applications that need the full range of support This also adds a hint to control rumble behavior, defaults 0 to maintain compatibility
pionere 60deadba 2022-01-17T17:22:30 re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory
Sam Lantinga b06866ef 2022-01-16T09:44:28 Entirely remove Xbox axis filtering, we don't want this at all.
Sam Lantinga 09aed102 2022-01-16T09:23:58 Don't send output reports to the Victrix Pro FS v2 It'll hang on reboot if it gets output reports, and it doesn't have functionality that requires them, so skip it.
Sam Lantinga 85961b61 2022-01-16T09:01:56 Disable Xbox axis deadzone handling by default Fixes https://github.com/libsdl-org/SDL/issues/5227
Sam Lantinga 1a50334c 2022-01-14T15:04:26 Fixed Xbox One trigger axis zero point
Sam Lantinga 16f5b9e3 2022-01-05T11:07:52 Filter jitter on Xbox One controllers when using raw input reports
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sylvain cb9f85e8 2021-11-22T11:18:01 Don't use "round", so that it's doesn't show up while searching for the function
Sylvain d31251b0 2021-11-21T22:30:48 use SDL's functions version inplace of libc version
Sam Lantinga 66058bbb 2021-11-15T16:52:56 Fixed exception accessing Bluetooth devices on Android 12 Since accessing Bluetooth prompts the user for permission on both Android and iOS, and we only need it for Steam Controller support, we'll leave it off by default. You can enable it by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init() Fixes https://github.com/libsdl-org/SDL/issues/4952
Ozkan Sezer a2c27d39 2021-11-13T17:56:28 SDL_hidapi_switch.c (ConstructSubcommand): lose use of '&' on rumbleData SwitchCommonOutputPacket_t->rumbleData is an array.
Ozkan Sezer 6ad0fb84 2021-11-13T17:55:10 SDL_hidapi_ps4.c, SDL_hidapi_ps5.c: use SDL_zeroa()
Ozkan Sezer a948ff84 2021-11-13T11:50:02 SDL_hidapijoystick.c: worked around a bogus 'unreachable code' warning.
Cameron Gutman afccabb8 2021-11-11T12:12:05 joystick: Add capability flags for rumble and trigger rumble When API limitations force us to guess, we favor a false positive (reporting support when it doesn't exist) compared to a false negative.
Cameron Gutman 1ccfbf96 2021-11-11T11:13:08 joystick: Convert HasLED() into a generic GetCapabilities() function
Sam Lantinga b9b0df40 2021-11-11T12:52:31 Fixed Linux build
Sam Lantinga c9ada1c1 2021-11-11T12:45:38 Made HIDAPI device change notifications available via SDL_hid_device_change_count()
Sam Lantinga 2a6feb50 2021-11-08T07:10:38 Removed accidental debugging commit (thanks @DomGries!)
Sam Lantinga 5b646cd1 2021-11-07T22:58:44 Build hidapi code into SDL as a new public API This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
Sam Lantinga fe2fe290 2021-11-07T11:48:16 Backed out accidentally committed PR https://github.com/libsdl-org/SDL/pull/4849
Sam Lantinga 86bc65a7 2021-11-07T11:35:12 Fixed non-Apple builds
Sam Lantinga c501d159 2021-10-03T14:10:21 Fixed range for Steam Controller sensor values
Sam Lantinga ea1a2b94 2021-10-02T09:12:57 Use the correct update rate for Steam Controller sensors
Sam Lantinga 8b745752 2021-10-01T21:32:21 Added support for the gyro and accelerometer on Steam Controllers Fixes https://github.com/libsdl-org/SDL/issues/4577
Sam Lantinga 345c161f 2021-09-22T09:06:45 Fixed some accidental uses of external C runtime functions
Sam Lantinga 7ed7644a 2021-09-07T17:37:47 Fixed compiling HIDAPI Steam Controller support with C89 compiler
Sam Lantinga 503ea8e8 2021-08-25T14:41:58 Don't modify the Nintendo Switch home LED state by default
Sam Lantinga 907943a2 2021-08-12T17:51:08 Added support for the Xbox One S Controller with 5.x series firmware
Ozkan Sezer 7aec0b90 2021-08-13T01:56:56 SDL_hidapi_xboxone.c: fix bogus 'uninitialized' warning from clang. The last 'size == 50' check is always true anyway.
Sam Lantinga cec5a129 2021-08-12T15:49:33 Fixed libudev hotplug notifications in the HIDAPI driver
Sam Lantinga 6eb4ebb5 2021-08-12T15:49:33 Simplified the HIDAPI Xbox One controller initialization
Sam Lantinga 584b89ab 2021-08-12T08:17:10 Added support for the color LED on the Xbox Elite Series 2 controller