src/joystick


Log

Author Commit Date CI Message
Sam Lantinga b3a0174b 2021-07-29T14:23:15 Scale the values correctly based on the sensor type (thanks @meyraud705)
Sam Lantinga 9d457aa4 2021-07-29T14:24:40 Don't uninitialize COM because of what appears to be a bug in Microsoft WGI reference counting. This fixes https://github.com/libsdl-org/SDL/issues/4488
Sam Lantinga a186a503 2021-07-29T06:43:39 Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller.
Sam Lantinga 2a53f831 2021-07-26T23:29:20 Fixed controllers showing up under both MFI and HIDAPI drivers The Game Controller Kit doesn't show the controllers at startup, so the HIDAPI driver sees them first and therefore gets preference when a controller is supported by both drivers. This fixes bug https://github.com/libsdl-org/SDL/issues/4209
Sam Lantinga 46869db0 2021-07-26T23:27:13 Fixed controller rumble on macOS Needed to add a strong reference to the haptics engine
Sam Lantinga a850fec7 2021-07-26T15:05:02 Added missing mapping for the Xbox Elite Controller on Linux This fixes https://github.com/ValveSoftware/steam-for-linux/issues/7826
Sam Lantinga ba8bc143 2021-07-26T12:09:33 Sort joystick entries in /dev/input This fixes https://github.com/libsdl-org/SDL/issues/4430
Sam Lantinga 8d527def 2021-07-26T10:18:18 Revert "hidapi_switch: Implement HD rumble effect (#4538)" This reverts commit 19082b115b8ba3fff93e1c317c380718086a509c, which broke rumble on the Nintendo Switch Pro controller
Narr the Reg 19082b11 2021-07-26T12:00:53 hidapi_switch: Implement HD rumble effect (#4538)
Sam Lantinga 10ec4c86 2021-07-24T22:11:22 Added support for the PowerA Nintendo Switch Spectra Controller
Sam Lantinga 3c9559f7 2021-07-24T19:43:56 Don't try to rumble third-party Nintendo Switch Pro controllers Sending rumble to the PowerA Spectra Nintendo Switch controller hangs input reports for a couple of seconds.
Sam Lantinga cc19b13b 2021-07-24T19:21:29 Fixed missing return statement
Sam Lantinga d4ac6b5e 2021-07-24T15:58:33 Detect buffer overflow when getting DirectInput device state This fixes bug https://github.com/libsdl-org/SDL/issues/4528
Ryan C. Gordon 5ae0dd4b 2021-07-24T17:44:35 joystick: Split out Linux opening code for reuse by querying code. This prevents an assertion whem LINUX_JoystickGetGamepadMapping tried to open the stick temporarily and messed with global state by doing so. Now the global state is only set in LINUX_JoystickOpen, but the common code is shared by both interfaces. Fixes #4198.
Sam Lantinga 09d1cea7 2021-07-24T11:15:09 Use the new controller type for the Luna and Stadia controllers
Sam Lantinga 808c3ae6 2021-07-24T10:36:56 Allow mapping Android controllers that just have a D-PAD and face buttons This fixes bug https://github.com/libsdl-org/SDL/issues/4327
Sam Lantinga 94b7a876 2021-07-24T09:10:18 Added SDL_GameControllerType enumerations for the Amazon Luna and Google Stadia controllers Fixes bug https://github.com/libsdl-org/SDL/issues/4019
german77 e6e8fe6d 2021-07-23T10:45:03 hidapi_switch: Implement analog rumble
Sam Lantinga 669714ca 2021-07-23T23:51:35 Added the ThrustMaster T.16000M as a flightstick
Sam Lantinga 384d86b5 2021-07-23T23:48:23 Fixed compile warnings with Visual Studio
Sam Lantinga adb75d64 2021-07-23T23:45:18 Fixed hotplug detection not working on UWP or when SDL isn't pumping Windows events This fixes bugs: https://github.com/libsdl-org/SDL/issues/4321 https://github.com/libsdl-org/SDL/issues/4147 Thanks to DJm00n for the suggestion!
Sam Lantinga 422b053b 2021-07-23T16:32:35 Added support for the full line of current PowerA Xbox Series X controllers
Sam Lantinga dc6f0443 2021-07-12T17:57:21 Added mapping for the Xbox Series X controller on tvOS
Sam Lantinga 947ad6e1 2021-07-12T17:57:21 Added support for the Xbox Series X controller on iOS and tvOS
Sam Lantinga 24059a19 2021-07-09T18:11:42 The RAWINPUT driver is no longer tied to HIDAPI in any way
Sam Lantinga d135c076 2021-07-08T13:22:41 Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers See testgamecontroller.c for an example of a custom PS5 trigger effect
Sam Lantinga 4a20dd3e 2021-07-08T07:38:18 Removed unnecessary comment, the mic button is in byte 16 on all firmware versions
Sam Lantinga 430bbcb8 2021-07-07T09:49:33 Added HIDAPI support for the Amazon Luna Controller connected over USB in DirectInput mode
Sam Lantinga 863f5669 2021-07-07T08:55:16 Fixed reading thumbstick axes and mic button on the Amazon Luna Controller firmware version 305164320
Dimitriy Ryazantcev 17ed8d80 2021-07-07T16:05:35 Added HIDAPI backend for Amazon Luna Controller Model T28B69 connected via Bluetooth LE (VID:0171, PID:0419). To enter Bluetooth pairing mode hold B and Action (button with circle) buttons for 3 seconds. It works via usual HIDAPI if special filter driver is not installed: https://www.amazon.com/gp/help/customer/display.html?nodeId=GZCT4CTFHXLHEB9T With that driver installed it mimics Xbox One controller and works via XInput under Windows. Under DInput this controller is not usable at all.
Sam Lantinga 00d67620 2021-07-06T11:32:11 Added the SteelSeries manufacturer to the Nimbus+ entry on macOS
Sam Lantinga 24e836b0 2021-07-06T10:00:09 Added controller mapping for the Nimbus+ controller on macOS when MFi support is not available
Dimitriy Ryazantcev 39302c92 2021-06-02T14:28:33 Add Steam Virtual Gamepad and Xbox 360 Wired Controller defines instead of magic values See https://partner.steamgames.com/doc/features/steam_controller/steam_input_gamepad_emulation_bestpractices for details on what is Steam Virtual Gamepad.
Sam Lantinga 0c4ac33a 2021-06-28T14:31:27 Added support for the Razer Wolverine Tournament Edition controller
Joshua Ashton ca383599 2021-06-27T01:49:31 Fix Anne Pro II keyboard showing up as a joystick Having used this for a couple years, I can definitely confirm that it is not a joystick.
Joshua Ashton c90bd3bf 2021-06-27T03:13:47 Add missing PS5 DualSense GUIDs Fixes my DualSense controller not being recognised as a SDL GameController which breaks Steam Input filtering causing SDL to fight for input.
Sam Lantinga 205b951b 2021-06-25T14:20:08 SDL_DINPUT_JoystickPresent() needs to do the full device enumeration It is called from WGI before the normal joystick detection has been run, so it needs to actually enumerate currently connected devices. We can skip the logic checking for other drivers also supporting this device, because that logic is duplicated from the call site.
Sam Lantinga ae6d9e34 2021-06-25T11:09:46 Correcting the name of the Amazon Luna Controller
Sam Lantinga 5042ab6f 2021-06-24T18:09:06 Added Linux and macOS mappings for the DirectInput mode of the Amazon Luna Controller
Sam Lantinga 5b051459 2021-06-24T18:09:04 Fixed warnings on Windows
Sam Lantinga 99700a5c 2021-06-24T18:09:01 SDL: add Windows mappings for Luna controllers for USB DirectInput mode and BT. Note: the triggers do not seem to work in BT mode.
Sam Lantinga 41fab853 2021-06-18T18:10:24 ControllerList: set the default deadzone for Ps5 controller back to same one as Xbox controllers. Too many users complained about drift.
Sam Lantinga a8b28939 2021-06-18T18:10:23 ControllerList: add more Xbox controllers from minidumps
Sam Lantinga 08eff56a 2021-06-18T18:10:22 ControllerList: add Brooks Mars controller to PS4 controller list
Sam Lantinga afd100f0 2021-06-18T17:37:46 Added support for the PowerA Fusion Pro 2 and the PDP Xbox Series X Afterglow and Blue controllers
Sam Lantinga d8dba5bc 2021-06-17T11:22:08 Added support for the Logitech G923 racing wheel
Paul Cercueil db5cd8c6 2021-06-12T14:57:34 joystick: virtual: Fix event injection for axes/hats SDL_JoystickSetVirtualAxisInner() and SDL_JoystickSetVirtualHatInner() did not properly sanitize the 'axis' and 'hat' parameters. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Paul Cercueil f3cf019e 2021-06-12T13:25:34 joystick: Add missing comma in joystick drivers list Without this comma it is impossible to enable both the Vita and Dummy drivers at the same time. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Dimitriy Ryazantcev f5122377 2021-06-10T14:06:32 Move SDL_IsXInputDevice check above actual joystick allocation
Dimitriy Ryazantcev 766d81ec 2021-06-10T14:01:04 Rewrite SDL_DINPUT_JoystickPresent method to avoid costly IDirectInput8_CreateDevice calls
Dimitriy Ryazantcev a6da2fbf 2021-05-25T12:33:23 Rename haptic methods to avoid confusion with joystick: `SDL_DINPUT_MaybeAddDevice`->`SDL_DINPUT_HapticMaybeAddDevice` `SDL_DINPUT_MaybeRemoveDevice`->`SDL_DINPUT_HapticMaybeRemoveDevice` `SDL_XINPUT_MaybeAddDevice`->`SDL_XINPUT_HapticMaybeAddDevice` `SDL_XINPUT_MaybeRemoveDevice`->`SDL_XINPUT_HapticMaybeRemoveDevice`
Dimitriy Ryazantcev 73dc68a7 2021-05-19T17:52:08 Simplify and cleanup DirectInput joystick backend code: - Do not call IDirectInputDevice8_QueryInterface(device, &IID_IDirectInputDevice8,...) on DIRECTINPUTDEVICE8 device - Get joystick VendorID and ProductID via IDirectInputDevice8_GetProperty(.., DIPROP_VIDPID, ..) call instead of messing with DIDEVICEINSTANCE.guidProduct - Normalize HID device interface path to upper case for stable operation of XInput check - Remove useless RawInput calls in SDL_IsXInputDevice() - just check for "IG_" string in HID device interface path that we already have There shouldn't be any observable behavior changes.
Dimitriy Ryazantcev f2f759dc 2021-02-26T15:34:34 Remove not used DirectInput ignored_devices list
Dimitriy Ryazantcev adc2d362 2021-02-26T15:33:41 Remove outdated and not used WIN_IsXInputDevice code
Andrew Murray cd67f42d 2021-06-04T12:20:47 add Linux mapping for brook fighting board (#4416) * added controller mapping for Brook fighting board * fixed formatting on Brook Universal Fighting Board controller mapping entry
Sjoerd Simons de4ba6eb 2021-05-27T12:41:41 Ignore the device version for Atari vcs controllers At least on bluetooth the guid user the version reported by the bluetooth device. Which for Atari vcs controllers is the firmware version. However the mapping will stay the same regardless of firmware version, so ignore the version entirely to avoid needing a new mapping entry for each firmware version. Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
Sjoerd Simons 89fd9821 2021-05-26T21:33:25 Add controller mapping for Atari vcs controllers This add controller mappings for the Atari vcs (modern) controller as well as the classic controller, for both bluetooth and USB connectivity. Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
Ozkan Sezer f498c281 2021-06-02T14:10:50 fixed build with SDL_JOYSTICK_RAWINPUT enabled after commit b81969d46f4b See: https://github.com/libsdl-org/SDL/pull/4388#issuecomment-852713792
Timo Gurr b63cb822 2021-05-30T01:57:56 Added T500RS to known wheel list
Dimitriy Ryazantcev b81969d4 2021-05-17T14:50:33 Be more explicit about Xbox 360/One device ids. When Xbox One/Series Controllers are connected via USB on Windows they all are using `XBOXGIP` driver and produce a special ProductID `0x02FF` (GIP software PID) for any connected controller. On the other hand `Xbox 360 Wireless Controller Reciever` (PID 0x0719) is using `XUSB` driver and produces special ProductID `0x02A1` (XUSB software PID) for each connected Xbox 360 Wireless Controller. Also fixed Xbox One Series X Controller comment.
Sam Lantinga 3fcaf5b4 2021-05-25T10:33:30 Fixed incorrect axis scaling for Nintendo Switch controllers
Sam Lantinga 333c8e75 2021-05-17T11:54:05 The PS5 driver supports Joystick LED
Kimplul 9e1d7bae 2021-05-12T17:43:39 Added T300RS to known wheel list
Ryan C. Gordon f4ab1c94 2021-05-10T13:08:34 gamecontrollerdb: Add entry for the 8BitDo Receiver for Linux. Fixes #3048.
Ryan C. Gordon bedc509a 2021-05-10T13:04:59 gamecontrollerdb: added entry for PowerA XBox One Controller for Linux. Fixes #3910.
Sam Lantinga 9231f1f1 2021-05-07T12:29:03 Added support for the PS5 controller on iOS and tvOS
Ethan Lee 40210f89 2021-04-26T15:54:14 winrt: Always use a thread for joystick support
Steven Noonan 4535d654 2021-04-22T14:35:59 HIDAPI_UpdateDiscovery: only treat "add" and "remove" events as relevant I have a buggy system which reports a udev "change" event for an empty USB-C port every 0.14 seconds, which causes annoying frame hitches because SDL decides that means it needs to do a libusb hid_enumerate, which is slow (~25ms!) because of the get_usb_string() calls in there. We only need to re-enumerate if we've seen a device added or removed, so let's filter out the change event first. Signed-off-by: Steven Noonan <steven@valvesoftware.com> Signed-off-by: Sam Lantinga <slouken@libsdl.org>
Sam Lantinga 499d31e9 2021-04-13T17:00:24 Cleanup Linux joystick code
Sam Lantinga b04136e7 2021-04-13T16:29:48 Fixed Xbox controller when using the default Linux gamepad mapping Tested with the Xbox Series X controller and the xow driver
Sam Lantinga 1aaafc2b 2021-04-13T16:29:46 Show the real name of the Xbox controller when using the generic mapping on Linux
Paul Cercueil 1542300a 2021-03-24T22:37:08 joystick: linux: Avoid checking for gamepad mapping each frame The information whether a specific joystick can be used as a gamepad is not going to change every frame, so we can cache the result into a variable. This dramatically reduces the performance impact of SDL2 on small embedded devices, since the code path that is now avoided was quite heavy. Fixes #4229. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Sam Lantinga 2a20cc0f 2021-04-12T11:25:42 SDL: let through a SetLED command every 5sec to deall with situations where the controller loses power when a computer is suspended CR: SamL
Sam Lantinga 4a07c73b 2021-03-26T13:53:58 Added mapping for the Amazon Luna controller on Linux
Sam Lantinga 07af9baa 2021-03-26T13:05:38 Use the correct name for the Amazon Luna Gamepad
Sam Lantinga ef363555 2021-03-26T13:03:29 Added mapping for the Amazon Luna controller on macOS
Sam Lantinga 3377861a 2021-03-26T11:57:19 Added support for the Amazon Game Controller to the HIDAPI driver
Sam Lantinga 0bdf4f95 2021-03-22T19:19:01 Disable system gestures on MFi controllers while they're open, so we get access to the back button, etc.
Ivan Epifanov a4ddb175 2021-03-08T19:28:58 Formatting
Ivan Epifanov e5cbe7cf 2021-02-14T00:30:42 Add l2/r2 axes, l3/r3 buttons. rumble and ledbar support for ds4
Ivan Epifanov a05f92da 2020-12-23T17:26:34 Update joystick api to 2.0.14
Ivan Epifanov 7d89f09f 2020-12-18T14:28:09 ISO C90 fixes
Ivan Epifanov 73b545ed 2020-11-02T19:38:20 Fix joystick support
Ivan Epifanov 2d64e37e 2020-11-02T18:09:43 Initial rebase of xerpi's port
JibbSmart c287087f 2021-02-23T09:26:03 Only change joystick->nbuttons for Joy-Cons, since they're the only ones that have these "paddles"
JibbSmart ee52624f 2021-02-22T17:23:13 Switch Joy-Con SL and SR buttons are now mapped to matching paddle positions so that all buttons can be accessed when using SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
Mathieu Eyraud 7a2b6f33 2021-02-22T13:32:42 Guard Inotify stuff with macro This fix implicit declaration of close and unused variable warning.
Sam Lantinga 1a17ab30 2021-02-21T11:03:26 Added mappings for popular controllers on Chromebooks
David Gow db58166e 2021-02-21T17:28:08 joystick: hidapi: Properly include <unistd.h> when inotify not available In the extremely unlikely event that inotify is not available (and, therefore, HAVE_INOTIFY is not #defined), SDL will no-longer build. This is because <unistd.h> is only included when HAVE_INOTIFY is defined, and PR #4098 adds a call to access(…, F_OK), which requires <unistd.h>. (Note that the F_OK symbol is the only one which actually prevented SDL from compiling, but both access() and close() fell back to implicit definitions, which is a bit concerning.) Fixes: 8d43f45a7b ("Don't use udev for joystick enumeration if running in a container")
Ludovico de Nittis 8d43f45a 2021-02-16T14:13:30 Don't use udev for joystick enumeration if running in a container If we are running in a container, like Flatpak[1] or pressure-vessel[2], it's likely that we are using user namespaces, therefore udev event notification via netlink won't work reliably. Use their filesystem API to detect them and automatically fallback to the inotify-based enumeration. [1] <https://flatpak.org/> [2] <https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/tree/master/pressure-vessel> Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Ludovico de Nittis 2c326915 2021-02-16T12:39:48 Use inotify for HIDAPI joystick enumeration if not using udev This improves SDL's ability to detect HIDAPI joystick hotplug in a container environment because we cannot reliably receive events from udev in a container. For a more detailed explanation of why this issue happens with containers, please check the previous commit "joystick: Use inotify to detect joystick unplug if not using udev" (b0eba1c5). Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Ludovico de Nittis b17242bf 2021-02-16T11:50:20 Allow libudev for HIDAPI joystick to be disabled at runtime As already explained in the previous commit "joystick: Allow libudev to be disabled at runtime" (13e7d1a9), libudev can fail in a container. To make it easier to experiment with, we add a new environment variable "SDL_HIDAPI_JOYSTICK_DISABLE_UDEV" that disables udev and let it fallback to the device enumeration using polling. Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Sam Lantinga 42607909 2021-02-20T22:51:57 Remove devices from the list after they've been disconnected due to read errors. This fixes problems with controllers not being re-detected when a computer goes to sleep and a controller is removed and plugged back in while it's asleep.
Matt Borgerson 4aa2e748 2021-02-16T10:20:29 Add Xbox Controller S entry to gamecontrollerdb
soredake 39153f81 2021-02-11T09:37:58 add Linux mapping for Ipega PG-9087S, closes #3783
Sam Lantinga 5427f486 2021-02-11T17:28:07 Added support for trigger rumble for all Microsoft Xbox One controllers
Sam Lantinga 1f7ec3fa 2021-02-11T17:27:22 Added support for the PowerA Xbox One Series X Wired Controller
Ozkan Sezer dc45a228 2021-02-08T00:20:56 avoid some pedantic warnings in array initializers
Sam Lantinga 9c3aa7f0 2021-02-06T15:43:17 SDL: fix packet handling for original version of Stadia FW
Cameron Gutman f4d58689 2021-02-03T18:00:22 Fix Xbox Series X controller on macOS There were two different implementations of IsBluetoothXboxOneController(), one in SDL_hidapi_xbox360.c and one in SDL_hidapi_xboxone.c. The latter had been updated to include USB_PRODUCT_XBOX_ONE_SERIES_X_BLUETOOTH while the former had not. This mismatch led to the Xbox Series X failing on macOS only. We have special code for handling the 360Controller driver for macOS which requires us to use the Xbox 360 driver for wired Xbox One controllers, and the SDL_hidapi_xbox360 version of IsBluetoothXboxOneController() was used to determine which devices were wired. In addition to adding the missing USB_PRODUCT_XBOX_ONE_SERIES_X_BLUETOOTH, this change moves IsBluetoothXboxOneController() into a single shared function which will ensure this bug won't happen again.