src/joystick/SDL_joystick.c


Log

Author Commit Date CI Message
Ozkan Sezer fd65aaa9 2021-01-23T17:30:50 move outdated winmm and psp joystick codes to struct _SDL_JoystickDriver build-tested only. (bug #5472.)
Ozkan Sezer 4a776557 2021-01-22T20:10:02 old os2 analogue joystick code ported from SDL-1.2. disabled by default, build-tested only.
Sam Lantinga 178ae70a 2021-01-20T12:18:10 Don't add paddle mappings for the Xbox One Elite Series 1 controller, since they can't be unmapped and read directly on that controller.
Sam Lantinga b2a0c712 2021-01-04T12:24:44 Allow setting the player index to -1, which turns off the player LED for PS5 controllers
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Sam Lantinga 3c07dd12 2020-11-25T10:28:48 Strip an extra '.' off of the HORI manufacturer name
Sam Lantinga 9fc4a4c9 2020-11-24T22:25:26 Revamped Xbox One HIDAPI init sequence Added support for querying the controller serial number on newer firmware
Sam Lantinga feab9d42 2020-11-24T06:40:13 5363 - Memory leak of joystick->sensors in SDL_JoystickClose Mathieu Eyraud Joystick->sensors is never freed.
Sam Lantinga 62e39b5f 2020-11-23T20:57:14 Fixed building with an older SDK and macOS target
Sam Lantinga 179bd665 2020-11-23T18:27:43 Don't enable PS5 controller support if DS4Windows is running - they conflict.
Sam Lantinga 5b3616c3 2020-11-23T18:24:05 Generalized the raw input controller driver and moved XInput/WGI detection into it for XInput devices This fixes bad report parsing for various newer Xbox controllers, and this driver is now preferred over XInput, since it handles more than 4 controllers.
Sam Lantinga 51ea6a6d 2020-11-17T22:09:52 Don't send controller gyro and accelerometer updates if the values haven't changed. This keeps SDL_PollEvent() from returning data continuously when polling controller state.
Sam Lantinga fcb21aa8 2020-11-17T10:30:20 Added API for sensors on game controllers Added support for the PS4 controller gyro and accelerometer on iOS and HIDAPI drivers Also fixed an issue with the accelerometer on iOS having inverted axes
Sam Lantinga d140d887 2020-11-16T17:36:47 Added SDL_JoystickGetSerial() and SDL_GameControllerGetSerial()
Sam Lantinga 7bbea0bb 2020-11-16T15:10:02 Fixed build warning
Ozkan Sezer c0f7325b 2020-11-15T17:10:15 SDL_PrivateJoystickForceRecentering: fix wrong loop counter usage. The typo seems to have been added by commit c7782fd6142b
Sam Lantinga 9f51fad3 2020-11-13T18:01:29 Added support for the touchpad on PS4 and PS5 controllers
Sam Lantinga 1e2caac5 2020-11-11T18:57:37 Added SDL_JoystickRumbleTriggers() and SDL_GameControllerRumbleTriggers()
Sam Lantinga e12457d8 2020-11-10T12:26:30 Added support for the Xbox Series X controller to the HIDAPI driver
Sam Lantinga c3dea231 2020-11-09T22:39:33 Added support for reading the paddles on a Xbox Elite Series 2 controller in Bluetooth mode
Sam Lantinga 3a3aaac2 2020-11-06T11:30:52 Added 4 auxiliary buttons to the game controller API Xbox Elite controllers use AUX1-AUX4 to represent the paddle buttons when using the HIDAPI driver PS4 and PS5 controllers use AUX1 to represent the touchpad button Nintendo Switch Pro controllers use AUX1 to represent the capture button
Sam Lantinga 4d79f966 2020-11-05T15:02:54 Added initial support for the Sony PS5 Controller
Sam Lantinga e555d453 2020-11-05T11:07:54 Added SDL_JoystickHasLED Currently, this is only supported by the PS4 HIDAPI driver.
Cameron Gutman 9d40a0f3 2020-08-29T16:50:26 Fix joystick device add events containing invalid device indexes This can happen if the application has not yet processed SDL_JOYDEVICEADD when the same joystick is removed. It may also happen if two joysticks are added and the second joystick is removed before the first joystick's SDL_JOYDEVICEADD has been processed by the application.
Sam Lantinga 345b4d7e 2020-05-29T13:37:21 Fixed bug 5161 - Autodetect controller mappings based on the Linux Gamepad Specification Jan Bujak I wrote a new driver for my gamepad on Linux. I'd like SDL to support it out-of-box, as currently it just treats it as a generic joystick instead of a gamepad. From what I can see the only way to do that is to either 1) pick one of the already supported controllers' PID, VID and button layouts and have my driver send that (effectively lying that it's something else), or 2) submit a preconfigured, hardcoded mapping to SDL. Both of those, in my opinion, are silly when we already have the Linux Gamepad Specification which standarizes this: https://www.kernel.org/doc/html/v4.15/input/gamepad.html Unfortunately SDL doesn't make use of it currently. So I've took it upon myself to add it; patch is in the attachments. Basically what the patch does is that if SDL finds no built-it controller mappings for a given joystick it then asks the joystick backend to autodetect it, and that uses the relevant evdev bits to figure out which button/axis is which. (See the specs for more details.) With this patch applied my own driver for my controller works out-of-box with SDL with no extra configuration and is correctly recognized as a gamepad; this is also going to be the case for any other driver which follows the Linux Gamepad Specification.
Sam Lantinga 1a1f1704 2020-05-27T10:35:43 Don't include the iOS joystick driver if joysticks are disabled
Ethan Lee 83cddd2e 2020-04-30T11:57:29 Add SDL_JoystickSetLED. Currently, this is only supported by the PS4 HIDAPI driver.
Brendan Shanks 032fa681 2020-04-24T14:03:30 Add Logitech G29 to steering wheel list
Sam Lantinga aba27928 2020-04-18T21:41:37 Added a Windows Gaming Input joystick driver This driver supports the Razer Atrox Arcade Stick Some of the quirks of this driver, inherent in Windows Gaming Input: * There will never appear to be controllers connected at startup. You must support hot-plugging in order to see these controllers. * You can't read the state of the guide button * You can't get controller events in the background
Ryan C. Gordon 8c165add 2020-04-07T23:17:27 joystick: Remove force_centering flag; we handle this on disconnect now.
Ryan C. Gordon 07f231ee 2020-03-26T18:47:04 joystick: Make sure recentering events happen before disconnect events. Fixes Bugzilla #5063.
Sam Lantinga 4dea340c 2020-03-16T12:23:38 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows Jimb Esser Add new RawInput controller API, and improved correlation with XInput/WGI Reorder joystick init so drivers can ask the others if they handle a device reliably Do not poll disconnected XInput devices (major perf issue) Fix various cases where incorrect correlation could happen Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation Correlate by axis motion as well as button presses Fix failing to zero other trigger Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init() Add missing device to device names Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices Updated to SDL 2.0.13 code with the following notes: New HID driver: xbox360w - no idea what that is, hopefully urelated SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data. SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem. Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason. Something changed in how devices get names, so getting generic names. Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
David Ludwig b2296506 2020-03-15T15:05:36 virtual joysticks: MSVC support part 1/2, make driver's .c file be uniquely named
David Ludwig cc908756 2020-03-15T13:25:49 virtual joysticks: removed ball support (Bug 5028)
Sam Lantinga 2be75c6a 2020-03-13T19:08:45 Fixed bug 5028 - Virtual Joysticks (new joystick backend) David Ludwig I have created a new driver for SDL's Joystick and Game-Controller subsystem: a Virtual driver. This driver allows one to create a software-based joystick, which to SDL applications will look and react like a real joystick, but whose state can be set programmatically. A primary use case for this is to help enable developers to add touch-screen joysticks to their apps. The driver comes with a set of new, public APIs, with functions to attach and detach joysticks, set virtual-joystick state, and to determine if a joystick is a virtual-one. Use of virtual joysticks goes as such: 1. Attach one or more virtual joysticks by calling SDL_JoystickAttachVirtual. If successful, this returns the virtual-device's joystick-index. 2. Open the virtual joysticks (using indicies returned by SDL_JoystickAttachVirtual). 3. Call any of the SDL_JoystickSetVirtual* functions when joystick-state changes. Please note that virtual-joystick state will only get applied on the next call to SDL_JoystickUpdate, or when pumping or polling for SDL events (via SDL_PumpEvents or SDL_PollEvent). Here is a listing of the new, public APIs, at present and subject to change: ------------------------------------------------------------ /** * Attaches a new virtual joystick. * Returns the joystick's device index, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nballs, int nbuttons, int nhats); /** * Detaches a virtual joystick * Returns 0 on success, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); /** * Indicates whether or not a virtual-joystick is at a given device index. */ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); /** * Set values on an opened, virtual-joystick's controls. * Returns 0 on success, -1 on error. */ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualBall(SDL_Joystick * joystick, int ball, Sint16 xrel, Sint16 yrel); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value); ------------------------------------------------------------ Miscellaneous notes on the initial patch, which are also subject to change: 1. no test code is present in SDL, yet. This should, perhaps, change. Initial development was done with an ImGui-based app, which potentially is too thick for use in SDL-official. If tests are to be added, what kind of tests? Automated? Graphical? 2. virtual game controllers can be created by calling SDL_JoystickAttachVirtual with a joystick-type of SDL_JOYSTICK_TYPE_GAME_CONTROLLER, with naxes (num axes) set to SDL_CONTROLLER_AXIS_MAX, and with nbuttons (num buttons) set to SDL_CONTROLLER_BUTTON_MAX. When updating their state, values of type SDL_GameControllerAxis or SDL_GameControllerButton can be casted to an int and used for the control-index (in calls to SDL_JoystickSetVirtual* functions). 3. virtual joysticks' guids are mostly all-zeros with the exception of the last two bytes, the first of which is a 'v', to indicate that the guid is a virtual one, and the second of which is a SDL_JoystickType that has been converted into a Uint8. 4. virtual joysticks are ONLY turned into virtual game-controllers if and when their joystick-type is set to SDL_JOYSTICK_TYPE_GAMECONTROLLER. This is controlled by having SDL's default list of game-controllers have a single entry for a virtual game controller (of guid, "00000000000000000000000000007601", which is subject to the guid-encoding described above). 5. regarding having to call SDL_JoystickUpdate, either directly or indirectly via SDL_PumpEvents or SDL_PollEvents, before new virtual-joystick state becomes active (as specified via SDL_JoystickSetVirtual* function-calls), this was done to match behavior found in SDL's other joystick drivers, almost all of which will only update SDL-state during SDL_JoystickUpdate. 6. the initial patch is based off of SDL 2.0.12 7. the virtual joystick subsystem is disabled by default. It should be possible to enable it by building with SDL_JOYSTICK_VIRTUAL=1 Questions, comments, suggestions, or bug reports very welcome!
Sam Lantinga 6318765d 2020-03-13T13:05:43 Handle entirely duplicated joystick product names, as well as vendor and product names that start with the name of the vendor, but with different case (e.g. 8bitdo 8BitDo)
Sam Lantinga de2001ee 2020-03-13T13:05:40 Fixed binding the D-PAD on the 8BitDo M30 controller
Sam Lantinga c44473ba 2020-03-12T19:47:30 Unified code to standardize joystick names
Cameron Gutman 4e0fb110 2020-03-07T19:21:21 Clear the old player index slot when moving to a new one
Cameron Gutman 165ccaa8 2020-03-07T17:20:04 Fix incorrect player index when assigning a joystick the same index twice Prior to this fix, we would hit the existing_instance >= 0 case and move the joystick again to a different index than the one requested by the caller. It also breaks the assumption that a SDL_JoystickID is only present in SDL_joystick_players at one location.
Sam Lantinga 07000bfc 2020-03-02T17:31:58 Fixed bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application Jake Breen I have tracked it down to a call on hid_device_info() -> HidD_GetManufacturerString (Line 499 in src\hidapi\windows\hid.c)
Sam Lantinga 3b3ae4d1 2020-03-02T15:06:47 Possible fix for bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application Jake Breen When I run SDL_INIT with SDL_INIT_JOYSTICK it stalls for about 10 seconds (last report was 10,615ms), but only if I'm currently playing audio. (Like in Spotify for example.) querying something related to device access (last dll loaded) 'BabbysFirst64.exe' (Win32): Loaded 'C:\Windows\SysWOW64\deviceaccess.dll'. I use a USB DAC because my mobo's audio out is pretty not great. And I've noticed unplugging it seems to solve the issue. I haven't noticed any other issues that are caused by my DAC. My DAC is the Sound BlasterX G1 https://us.creative.com/p/gaming-headsets/sound-blasterx-g1 Vid = 041E PID = 3249 My system specs: - Windows 10 Pro - Ryzen 2700x - 16GB Ram - Nvidia 2070 RTX Additional USB devices plugged in: - Valve Index - Xbox One Elite Controller
Sam Lantinga 8d146363 2020-02-19T08:26:00 Fixed support for third party Xbox 360 wireless controller dongle
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.
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 a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
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 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 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 e22e77da 2019-12-19T15:01:35 Added an untested driver for the Nintendo GameCube adapter, based on code contributed by Ethan Lee
Sam Lantinga 52b6ab21 2019-12-16T17:11:23 Added support for the SteelSeries Stratus Duo
Sam Lantinga 0352814a 2019-12-13T16:07:25 Added general remapping of controller manufacturer
Sam Lantinga 4d4e5584 2019-12-12T19:07:26 Fixed binding D-pad on NES30 controller
Sam Lantinga 0f529160 2019-12-11T17:47:01 Added custom names for some controllers
Sam Lantinga 8342fa7c 2019-12-05T13:48:08 Fixed controller mapping issues caused by PS3 gyro jitter
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 733f2525 2019-11-22T14:09:24 Fixed build
Sam Lantinga b5aff9d7 2019-11-22T13:12:12 Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to return the type of controller attached.
Sylvain Becker b7ab3b39 2019-10-23T08:50:57 Fixed bug 4838 - Use after free in SDL_JoystickUpdate (Thanks!)
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 a06d8cd0 2019-07-17T16:47:17 Merged latest changes from Steam into controller_type.h
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 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 9261e473 2019-06-07T09:00:24 Potential fix for a crash we're seeing on Android that should in theory never happen.
Sam Lantinga 9a8d5215 2019-03-27T08:17:05 Handle potentially calling SDL_JoystickUpdate() and SDL_JoystickQuit() at the same time.
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.
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sam Lantinga 6ed76ae1 2018-12-05T14:46:03 Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows
Sam Lantinga b73703b9 2018-11-19T21:17:00 Fixed bug 4391 - hid_enumerate() sometimes causes game to freeze for a few seconds Daniel Gibson Even though my game (dhewm3) doesn't use SDL_INIT_JOYSTICK, SDL_PumpEvent() calls SDL_JoystickUpdate() which ends up calling hid_enumerate() every three seconds, and sometimes on my Win7 box hid_enumerate() takes about 5 seconds, which causes the whole game to freeze for that time.
Ryan C. Gordon 62494a2e 2018-10-31T15:03:41 Merge SDL-ryan-batching-renderer branch to default.
Sam Lantinga 14329256 2018-10-25T16:53:14 Generalized the XInput user index into a player index
Sam Lantinga 545febcf 2018-10-25T13:22:34 Fixed initializing XInput user index
Sam Lantinga 9987ca69 2018-10-25T12:54:42 Added SDL_JoystickGetXInputUserIndex()
Ryan C. Gordon b262b0eb 2018-10-22T20:50:32 Small stack allocations fall back to malloc if they're unexpectedly large.
Ozkan Sezer 5454765a 2018-09-28T17:01:24 replace bool stuff in controller_type.h with SDL_bool. remove bool<->SDL_bool dance in SDL_joystick.c:SDL_IsJoystickSteamController() after the controller_type.h change.
Sam Lantinga 5febdfce 2018-09-24T11:49:25 Fixed whitespace
Sam Lantinga 59a2d12c 2018-09-17T11:35:22 Fixed creating an Android game controller mapping for HIDAPI devices on initialization
Sam Lantinga 6b3f11e2 2018-08-20T21:18:56 Fixed code style
Ryan C. Gordon 67a48ad1 2018-08-10T15:04:08 haiku: Patched to compile with new joystick interfaces.
Ryan C. Gordon 67764070 2018-08-10T14:42:40 bsd: Update joystick code for new interfaces. (this is an untested push to see if buildbot likes it.)
Ryan C. Gordon b692c352 2018-08-10T14:32:30 emscripten: Patched to compile with new joystick interfaces.
Sam Lantinga 888bf1af 2018-08-09T16:03:50 Worked around bug with Sony PS Now PS3 controller where DirectInput polling will continue to return success after the controller is unplugged. The code is now reliant on SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() being called correctly when devices are added or removed on Windows
Sam Lantinga f35e97ba 2018-08-09T16:03:29 Fixed Windows build
Sam Lantinga d2042e1e 2018-08-09T16:00:17 Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
Sam Lantinga 8e062f69 2018-03-19T14:42:51 Generalized the handling of instantaneous guide button presses so there's a minimum of 100 ms between guide button press and release. This happens with at least the following controllers: All Apple MFI controllers, ASUS Gamepad, XiaoMi Bluetooth Controller
Sam Lantinga 9e651b69 2018-03-06T14:51:50 Try to dynamically create a default Android game controller mapping based on the buttons and axes on the controller. Include the controller USB VID/PID in the GUID where possible, as we do on other platforms.
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga b647bd06 2017-10-10T17:41:41 The event filter and event watch functions are now thread-safe
Sam Lantinga d90fce3c 2017-10-10T11:10:15 Exposed the joystick locking functions for multi-threaded access to the joystick API
Sam Lantinga 5ab5c9b7 2017-09-22T08:56:09 Avoid duplicate joystick axis events
Sam Lantinga eaab6098 2017-09-21T10:29:17 Only apply the jitter filter to prevent unexpected motion on axes that haven't been touched.
Sam Lantinga de91b124 2017-08-14T06:28:21 Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks Patches contributed by Ozkan Sezer
Sam Lantinga 059d9e46 2017-08-12T17:41:59 Fixed bug 2950 - wrong axes values are set on joystick initialization Edward Rudd Device: Logitech Rumble Gamepad F510 in Xinput mode. Upon opening the joystick the values of the axes are queried via PollAllValues are not actually set on the device all the time. This can easily be seen in the testjoystick or testgamecontroller test programs,as the testjoystick shows all axes in the center until one 'tickles' the triggers., and the testgamecontroller will show the triggers as 'on' until on 'tickles' the triggers. Upon further research the culprit is the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint. In the default value events are ignored until there is an active window, Thus in cases where the joystick system is initialized and controllers opened before the initial window is created & focuses, the initial values will be incorrect. Here is my current workaround in the game I'm working on porting.. SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_GameController* gamepad = SDL_GameControllerOpen(index); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "0");
Sam Lantinga c49fa37c 2017-08-09T11:59:29 Added SDL hints to filter the set of game controllers reported by SDL
Sam Lantinga 1eb92f63 2017-04-06T06:30:43 Implemented Linux joystick blacklist Based on https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py This fixes a few devices that are not actually joysticks showing up as such in SDL
Sam Lantinga 763e1389 2017-03-09T16:09:16 Added an API to get the joystick instance ID before opening the device: SDL_JoystickGetDeviceInstanceID()
Sam Lantinga be28d7c8 2017-01-31T12:30:55 Added support for the Saitek Pro Flight X-56 Rhino
Sam Lantinga 6717a3d3 2017-01-31T12:23:29 Added support for the HOTAS Warthog throttle