src/joystick/linux/SDL_sysjoystick.c


Log

Author Commit Date CI Message
Sam Lantinga b8c00bf9 2021-11-07T13:11:29 Allow opening joysticks that are read-only on Linux Fixes https://github.com/libsdl-org/SDL/issues/4713
Sam Lantinga 345c161f 2021-09-22T09:06:45 Fixed some accidental uses of external C runtime functions
Sam Lantinga bf97c5a2 2021-09-08T14:47:40 Make sure SDL file descriptors don't leak into child processes
Sam Lantinga 130b6beb 2021-08-24T17:01:34 Manually scan for Linux joysticks before udev scan runs This allows us to have joysticks sorted by insert time at startup, fixing https://github.com/libsdl-org/SDL/issues/4688
Sam Lantinga cbccf5bb 2021-08-24T17:01:06 Use SDL_GetHint() instead of SDL_getenv() for Linux joystick hints
Andrei Alexeyev e9179314 2021-08-11T21:27:42 joystick/linux: fix memleaks; streamline joylist item removal
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 cc19b13b 2021-07-24T19:21:29 Fixed missing return statement
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 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
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>
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
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>
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>
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga 8795ca70 2020-12-14T09:15:47 Fixed bug 5241 - SDL on Linux needs a way to turn deadzones off pj5085 I added some printf to verify the math being done. Of the three joysticks I have, it works correctly for at least two, and seems to work correctly for the third. I say "seems to" because, for the third joystick, the values never go through the AxisCorrect function, and thus never hit my printf statements, even though they did in the version I wrote my patch against. I'm not sure what's going on there, but it at least seems to be working correctly in as much as I can tell. I note this result in particular, for an SNES Gamepad (min=0, max=255): Joystick value 0 becomes -32768 Joystick value 127 becomes 0 Joystick value 255 becomes 32767 Without the code that forces a zero point, the 127 input value would become -129, so I think you see why I added that code to turn it into zero. However, I think Kai Krakow has a point about how SDL shouldn't assume that there should be a center. Obviously in the majority of cases there actually should be a center, and the code that turns that 127 into an actual 0 is creating only a 0.2% error over 0.4% of this joystick's range. However, what if there is an axis that is some kind of special control, like a 4-position switch, and, for whatever reason, the joystick reports it as an axis with 4 possible values, 0 to 3? In that case, mutilating the two center values to the same value is much more of an error and and turns that 4-position switch into a 3-position switch. If any joystick does this with a 2-position switch, then this code would render that control entirely useless as it would report the same value with the switch in either position. Obviously the code could require that there be at least N possible values, to guess whether something is a proper axis or just some kind of switch, but the choice of N would be arbitrary and that's ugly. I guess the real problem here is that my gamepad is just kind of broken. It should be reporting a range of -1 to +1 since that's what it actually does. Also, as Kai Krakow points out, it's probably not SDL's place to fix broken hardware. I'll add that, if SDL does fix broken hardware, it should probably actually know that it's broken rather than be merely guessing that it is. So, to the extent that SDL is able to do stuff like this, perhaps it's something better left for the user to configure in some kind of config file.
Ozkan Sezer b6e63625 2020-12-13T15:32:24 fix bug #5395: handle old systems where inotify_init1 is not available
Sam Lantinga db0a2025 2020-12-12T23:48:02 Fixed bug 5241 - SDL on Linux needs a way to turn deadzones off pj5085 It occurred to me that my simple patch that comments out a few lines of code does not correctly remove the dead zone since the calculation presumably assumes the dead zone has been cut out of the range. Then, while looking into how to make it output the correct range of values, I realized SDL wasn't returning the correct range of values to begin with. This line of code was already present: printf("Values = { %d, %d, %d, %d, %d }\n", absinfo.value, absinfo.minimum, absinfo.maximum, absinfo.fuzz, absinfo.flat); For my joystick this yeilds: Values = { 0, -127, 127, 0, 15 } Then this code calculates the coefficients: In SDL1: joystick->hwdata->abs_correct[i].coef[0] = (absinfo.maximum + absinfo.minimum) / 2 - absinfo.flat; joystick->hwdata->abs_correct[i].coef[1] = (absinfo.maximum + absinfo.minimum) / 2 + absinfo.flat; t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * absinfo.flat); if ( t != 0 ) { joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t; } else { joystick->hwdata->abs_correct[i].coef[2] = 0; } In SDL2: joystick->hwdata->abs_correct[i].coef[0] = (absinfo.maximum + absinfo.minimum) - 2 * absinfo.flat; joystick->hwdata->abs_correct[i].coef[1] = (absinfo.maximum + absinfo.minimum) + 2 * absinfo.flat; t = ((absinfo.maximum - absinfo.minimum) - 4 * absinfo.flat); if (t != 0) { joystick->hwdata->abs_correct[i].coef[2] = (1 << 28) / t; } else { joystick->hwdata->abs_correct[i].coef[2] = 0; } Neither calculates the correct coefficients for the code in the AxisCorrect function. In SDL1: if ( value > correct->coef[0] ) { if ( value < correct->coef[1] ) { return 0; } value -= correct->coef[1]; } else { value -= correct->coef[0]; } value *= correct->coef[2]; value >>= 14; In SDL2: value *= 2; if (value > correct->coef[0]) { if (value < correct->coef[1]) { return 0; } value -= correct->coef[1]; } else { value -= correct->coef[0]; } In SDL1, the calculated coefficients are coef[0]=15, coef[1]=-15 and coef[2]=5534751. So with a full-scale input of 127, it calculates an output value of 37835, which is considerably out of range. In SDL2, the calculated coefficients are coef[0]=30, coef[1]=-30, and coef[2]=1383687. So with a full-scale input of 127, it calculates the same output value of 37835. I tested it with the 3 joysticks I have, and it produces out-of-range values for all of them. Anyway, since dead zones are garbage, I just deleted all of that junk and wrote some code that takes the absinfo.minimum and absinfo.maximum values and uses them to scale the axis range to -32767 through +32767. I also made it detect when a range doesn't have an integer center point, e.g. the center of -128 to + 127 is -0.5. In such cases, if either value to the side of the center is provided, it zeros it, but it otherwise doesn't implement any kind of dead zone. This seemed important with my gamepad which provides only the values of 0, 127, and 255, since without this hack it would never be centered. Also, the previous minimum output value was -32768, but as that creates an output range that has no true center, I changed the minimum value to -32767. I tested it with the 3 joystick devices I have and it seems to create correct values for all of them.
Sam Lantinga 0ccb3afd 2020-12-12T22:33:11 Fixed polling values after SYN_DROPPED event
Sam Lantinga 13a4caf1 2020-12-12T22:08:02 Fixed bug 4286 - Joystick subsystem causes "not responding" when app is in the background Added a hint to control whether a separate thread should be used for joystick events. This is off by default because dispatching messages in other threads appears to cause problems on some versions of Windows.
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 59f28b7f 2020-12-03T18:17:01 Fixed whitespace
Sam Lantinga c8c818d7 2020-11-23T21:14:37 Fixed bug 5360 - non-libudev joystick detection doesn't see controllers that were already connected Simon McVittie When watching for hotplug events we can poll the inotify fd, but we still need to scan /dev/input once per process, otherwise we'll fail to detect devices that were already connected.
Simon McVittie 8e2746cf 2020-11-23T21:10:48 joystick: Don't use udev in Flatpak or pressure-vessel container Flatpak[1] and pressure-vessel[2] are known to use user namespaces, therefore udev event notification via netlink won't work reliably. Both frameworks provide a filesystem API that libraries can use to detect them. Do that, and automatically fall back from udev-based device discovery to the inotify-based fallback introduced in Bug #5337. [1] <https://flatpak.org/> [2] <https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/tree/master/pressure-vessel> Signed-off-by: Simon McVittie <smcv@collabora.com>
Sam Lantinga e9869e07 2020-11-23T21:08:19 Fixed bug 5335 - enable joystick/haptic/evdev support by default on FreeBSD Alex S Evdev headers aren't actually included in the base system (well, it has a private copy), they are available through the devel/evdev-proto port instead. We also have devel/libinotify and devel/libudev-devd shims, I didn't verify whether they work with SDL.
Ryan C. Gordon eaa53a19 2020-11-23T22:16:07 joystick: On Linux, don't try to close an invalid inotify file descriptor.
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
Ozkan Sezer c122e9b9 2020-11-12T14:11:50 linux/SDL_sysjoystick.c (MaybeRemoveDevice): remove SDL_USE_LIBUDEV guards fixes bug #5349.
Simon McVittie b0eba1c5 2020-11-11T19:15:32 joystick: Use inotify to detect joystick unplug if not using udev This improves SDL's ability to detect joystick hotplug in a container environment. We cannot reliably receive events from udev in a container, because they are delivered as netlink events, which are authenticated by their uid being 0. However, in a user namespace created by an unprivileged user (for example bubblewrap, as used by Flatpak and Steam's pressure-vessel-wrap), the kernel does not allow us to map uid 0, and the netlink events appear to be from the kernel's overflowuid (typically 65534/nobody), meaning libudev cannot distinguish between genuine uevents from udevd and an attack by a malicious local user. Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie fdd945f2 2020-11-11T19:14:52 joystick: Use a better heuristic to guess what is a joystick Previously we only checked for at least one button or key and at least the X and Y absolute axes, but this has both false positives and false negatives. Graphics tablets, trackpads and touchscreens all have buttons and absolute X and Y axes, but we don't want to detect those as joysticks. On normal Linux systems ordinary users do not have access to these device nodes, but members of the 'input' group do. Conversely, some game controllers only have digital buttons and no analogue axes (the Nintendo Wiimote is an example), and some have axes and no buttons (steering wheels or flight simulator rudders might not have buttons). Use the more elaborate heuristic factored out from SDL's udev code path to handle these cases. In an ideal world we could use exactly the same heuristic as udev's input_id builtin, but that isn't under a suitable license for inclusion in SDL, so we have to use a parallel implementation of something vaguely similar. Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie 8db3171b 2020-11-11T19:14:34 udev: Factor out SDL_EVDEV_GuessDeviceClass This works on capability bitfields that can either come from udev or from ioctls, so it is equally applicable to both udev and non-udev input device detection. Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie 13e7d1a9 2020-11-11T19:14:11 joystick: Allow libudev to be disabled at runtime Device enumeration via libudev can fail in a container for two reasons: * the netlink protocol between udevd and libudev is considered private, so there is no API guarantee that the version of libudev in a container will understand netlink messages from a dissimilar version of udevd on the host system; * the netlink protocol between udevd and libudev relies for security on being able to check the uid of each message, but in a container with a user namespace where host uid 0 is not mapped, the libudev client cannot distinguish between messages from host uid 0 and messages from a different, malicious user on the host To make this easier to experiment with, always compile the fallback code path even if libudev is disabled. libudev remains the default if enabled at compile time, but the fallback code path can be forced. Signed-off-by: Simon McVittie <smcv@collabora.com>
Sam Lantinga 1e2caac5 2020-11-11T18:57:37 Added SDL_JoystickRumbleTriggers() and SDL_GameControllerRumbleTriggers()
Sam Lantinga e555d453 2020-11-05T11:07:54 Added SDL_JoystickHasLED Currently, this is only supported by the PS4 HIDAPI driver.
Kai Krakow c3ecf18c 2020-07-21T23:38:42 Linux: Add hint for disabling deadzones
Ryan C. Gordon 0e98040d 2020-06-28T16:23:05 joystick: Linux joysticks now recover better from dropped events. Fixes Bugzilla #4830.
Sam Lantinga 9fa8d6d0 2020-06-08T17:07:55 Define constants not available on older kernels
Sam Lantinga ae9ff11b 2020-05-29T14:54:07 The zero happens at a higher level now
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.
Ethan Lee 83cddd2e 2020-04-30T11:57:29 Add SDL_JoystickSetLED. Currently, this is only supported by the PS4 HIDAPI driver.
Sam Lantinga 885b3f69 2020-03-23T14:10:25 Don't check the HIDAPI driver for the virtual device created by xow
Sam Lantinga c44473ba 2020-03-12T19:47:30 Unified code to standardize joystick names
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 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 6dc172d0 2020-01-23T12:53:39 Turn off rumble on drivers which don't respect the replay.length value
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga c14a59d9 2020-01-11T13:38:50 Worked around an issue where the kernel would lose the force feedback effect
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 0f529160 2019-12-11T17:47:01 Added custom names for some controllers
Sam Lantinga 2a161e7a 2019-12-10T11:30:56 Remove any duplicate manufacturer in the joystick name
Cameron Gutman 55eb7621 2019-11-20T20:27:45 Use stat() to minimize input device opens when not using udev Calling open() on input devices can generate device I/O which blocks the main thread and causes dropped frames. Using stat() we can avoid opening anything unless /dev/input has changed since we last polled. We could have used something fancy like inotify, but it didn't seem worth the added complexity for this uncommon non-udev case.
Sam Lantinga 9da4bfc1 2019-10-22T10:57:07 Added support for the Power A Nintendo Switch Enhanced Wireless Controller
Sam Lantinga c10a8742 2019-07-31T10:20:37 Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent()
Andrew Eikum c172f36b 2019-07-31T11:14:48 joystick: Ensure HIDAPI is initialized before calling it
Cameron Gutman a4bfe2a4 2019-06-24T21:08:26 Allow hotplugging joysticks without udev
Sam Lantinga 747df96e 2019-06-12T10:38:49 Better patch to make it more clear what's going on
Sam Lantinga 3fbaa5da 2019-06-12T10:35:47 The hat index passed to the application should be zero-based with no holes
Sam Lantinga a1a2f9b9 2019-06-12T10:32:36 Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux) Matteo Beniamino Pressing a trigger button on a Steam Controller causes a segmentation fault both with stable version and latest mercurial head on Linux. I'm using the recent hid_steam kernel module with lizard_mode disabled (that is no keyboard/mouse emulation). I suspect this is what's happening: the driver exposes two hats. The two hats have indices 0 and 2. Inside linux/SDL_sysjoystick.c two hats are allocated in allocate_hatdata for joystick->hwdata->hats. In HandleHat function the hat parameter (that can be 2) is directly used as the index of the array that only has two elements, causing an out of bounds access. SDL is not expecting to have "holes" between hats indices. The index 2 is calculated in HandleInputEvents() as (ABS_HAT2X - ABS_HAT0X) / 2 where ABS_HAT2X is the value associated to the hat inside the hid_steam module.
Sam Lantinga 56b7f4cf 2019-06-08T14:40:27 Fixed bug 4583 - PollAllValues appears to use an incorrect index for all axes above 0x18 Noam Preil In src/joystick/linux/SDL_sysjoystick.c: The ConfigJoystick function's axes detection starts with a for loop using an index i for Linux's axes names. When i gets to ABS_HAT0X, it's set to ABS_HAT3Y and a continue statement appears, to skip the hats. This makes sense, as SDL handles hats separately from axes. However, in PollAllValues, *two* indices are used: a and b. Both start out the same, and remain so until the hats are reached. At that point, a becomes identical to the i from ConfigJoystick's loop, but b is equal to a - (ABS_HAT3Y - ABS_HAT0X), or a - 8. While all the joystick->hwdata->abs_* structures in ConfigJoystick used i - which would here be a - as both the index and the ioctl argument, PollAllValues uses b for the structure index and a as the ioctl argument. It would appear, however, that no joystick HAS such axes, and that the b index is entirely unnecessary. I tested three separate joysticks, and while that was far from a complete listing, I was unable to find a joystick with an axis above 0x08.
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Ryan C. Gordon a7563bcd 2018-12-05T19:03:15 joystick: Removed unused variable.
Sam Lantinga 6ed76ae1 2018-12-05T14:46:03 Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows
Sam Lantinga 2e348c1f 2018-11-14T13:37:22 Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick maxxus The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events. Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
Sam Lantinga 14329256 2018-10-25T16:53:14 Generalized the XInput user index into a player index
Sam Lantinga 708ad1fd 2018-10-16T14:58:07 Fixed updating the rumble parameters on Linux
Sam Lantinga 63107524 2018-08-15T19:53:34 Fixed input from the Steam Virtual Gamepad on Mac OS X
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 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 e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga d8286479 2017-09-22T08:30:52 Added stubs for simple Steam Controller support
Sam Lantinga c49fa37c 2017-08-09T11:59:29 Added SDL hints to filter the set of game controllers reported by SDL
Philipp Wiesemann 22c221f3 2017-06-11T22:30:58 linux: Changed internal functions to be static.
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 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga aa03b9d7 2016-11-22T22:14:28 The XBox One S controller sends keys outside the standard joystick button range
Philipp Wiesemann 97aa5775 2016-11-16T22:08:51 Fixed empty parameter list in signatures of internal functions.
Sam Lantinga 57d01d7d 2016-11-13T22:57:41 Patch from Sylvain to fix clang warnings
Sam Lantinga ac74e16c 2016-11-10T17:19:34 Standardized the format of the SDL joystick GUID and added functions to retrieve the USB VID/PID from a joystick and game controller.
Sam Lantinga ad1bfea5 2016-08-26T12:18:08 Added SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() Updated the removal code to iterate over all joystick add messages instead of just the first one.
Sam Lantinga c69bce67 2016-08-26T11:16:44 commit 1170112da3776fdb06425f62d57b63144c33dc51 Author: James Zipperer <james.zipperer@synapse.com> Date: Sun Aug 21 01:19:19 2016 -0700 bugfix for controller / joystick add / remove being in the event queue at the same time
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Ryan C. Gordon f99d6e1d 2015-05-26T12:03:51 Linux joystick: Look at entire axis namespace for controls (thanks, "spaz16"!). This apparently has fallout: the PS4 (and maybe PS3?) controllers apparently report some bogus axes, but it won't change the axes we currently expect, and thus the game controller config string is still stable. Fixes Bugzilla #2719.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Philipp Wiesemann 3e1d3629 2015-04-15T21:29:55 Fixed typo in internal joystick documentation comments.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Ryan C. Gordon 162ef5ea 2015-03-24T13:52:01 Cleanups in the joystick code. Removed some redundant state and other confusions. Fixes Bugzilla #2738.
Philipp Wiesemann da843f6a 2015-03-11T21:14:21 Updated internal documentation comments.
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Sam Lantinga a7258066 2015-01-29T13:33:53 Fixed game controller hotplug support for some embedded Linux devices When guessing the device class, it ends up being 0 for devices that have been removed (because the device node no longer exists)
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
Ryan C. Gordon 446d19c4 2014-06-14T23:31:23 Removed SDL_SYS_JoystickNeedsPolling(). It was simpler to just have the polling (actually: hotplug detection) functions return immediately if it's not an appropriate time to poll. Note that previously, if any joystick/controller was opened, we would poll every time anyhow, skipping this function.
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??