src/joystick/SDL_gamecontroller.c


Log

Author Commit Date CI Message
Sam Lantinga 89abbbfe 2016-10-07T18:24:34 Fixed bug 3438 - SDL_GameControllerEventWatcher: Log on event with value >= k_nMaxReverseEntries
Sam Lantinga 8bc5c57d 2016-10-07T16:13:37 Fixed recentering triggers when the application doesn't have focus
Sam Lantinga 72164985 2016-10-07T16:04:15 Fixed bug 2823 - Release events for triggers receive wrong centered value Ryochan7 I have been using SDL 2 for a little project that I have been developing for a while. My project is called antimicro and it takes gamepad input and then translates gamepad events into keyboard and mouse events. SDL is used to read the input from an XInput gamepad and it works great for the most part. However, there is one glaring problem that I have encountered. When a device is unplugged and SDL sends the centered value release events for all axes, buttons, and hats, SDL does not use the proper centered value for the triggers. It pushes an SDL_JOYAXISMOTION event onto the queue with a value of 0 for all axes. That value is converted to around 16,000 for a Game Controller. That value is incorrect for triggers and, in my program, that causes any bindings that are assigned to the triggers to get activated. With most profiles, that will typically mean that a mouse right click and left click will be activated before the device is finally seen as removed and then those bindings are released by antimicro.
Sam Lantinga c2e25651 2016-10-01T13:02:20 Fixed bug 3424 - SDL_GameController: Increase k_nMaxReverseEntries ny00 On Android, the keycodes KEYCODE_BUTTON_1..16 (actual values 188-203) are translated to SDL_Joystick buttons no. 20-35. These are currently ignored in SDL_gamecontroller.c. The attached patch fixes this, by increasing k_nMaxReverseEntries from 20 to another arbitrary bound of 48. Side-note: Maybe some log should be emitted in case of going over any such bound?
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
Ethan Lee 2a754ca7 2016-03-07T08:22:55 Allow mappings to be added before GameControllerInit
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Sam Lantinga d1e6a2eb 2015-12-09T12:11:40 Added broad support for wireless XBox 360 controllers on Linux
Ryan C. Gordon e6ad29ae 2015-11-14T12:35:45 Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID().
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().