src/joystick


Log

Author Commit Date CI Message
Philipp Wiesemann db878a43 2015-04-16T22:02:03 Linux: Removed not needed platform info from two entries of controller database. Not needed because entries of this file are selected by conditional compilation.
Philipp Wiesemann 3e1d3629 2015-04-15T21:29:55 Fixed typo in internal joystick documentation comments.
Philipp Wiesemann e6b7b38c 2015-04-15T21:27:10 Emscripten: Simplified implementation of joystick update function. The function was implemented using four loops but only needed two.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Alex Szpakowski 26c28114 2015-04-08T15:35:07 Merged default into iOS-improvements
Ryan C. Gordon 78026f54 2015-04-08T02:24:17 Patched to compile on Windows.
Ryan C. Gordon 785618af 2015-04-08T02:14:59 DirectInput: ignore everything but joysticks and gamepads (thanks, Justin!). Fixes Bugzilla #2460.
Alex Szpakowski df98b11c 2015-04-06T15:26:37 Merged default into iOS-improvements
Sam Lantinga c5d9d164 2015-04-01T18:22:42 Added a game controller entry for the NVIDIA Controller
Ryan C. Gordon 162ef5ea 2015-03-24T13:52:01 Cleanups in the joystick code. Removed some redundant state and other confusions. Fixes Bugzilla #2738.
Ryan C. Gordon 4a071b31 2015-03-24T03:24:57 Mac: patched to compile with haptic subsystem disabled (thanks, Rodrigo!). Fixes Bugzilla #2717.
Ryan C. Gordon 54f4725a 2015-03-24T02:48:16 Ran hardcoded game controller database through sort_controllers.py.
Ryan C. Gordon a300a735 2015-03-24T02:47:25 Added Logitect RumblePad 2 controller mapping for Linux (thanks, Nicholas!). Fixes Bugzilla #2091.
Philipp Wiesemann da843f6a 2015-03-11T21:14:21 Updated internal documentation comments.
Alfred Reynolds d34d608e 2015-03-02T11:43:24 SDL - fix crash on OSX when removing a device. If the remove happened due to the CFRunLoopRunInMode call in SDL_SYS_JoystickDetect then we would delete the device right away, before SDL_SYS_JoystickUpdate could clean it up. So move the CFRunLoopRunInMode to after the cleanup logic, preventing this case. This does mean that adds and removes of joysticks now take 1 extra frame to show up.
Philipp Wiesemann 8321efba 2015-02-22T23:21:32 Emscripten: Fixed out of range joystick device index after joystick disconnect. After disconnecting a joystick the remaining kept their original device index. This was not correct because the device index must be a number between 0 and SDL_NumJoysticks(). It was fixed with ideas from SDL's joystick implementation for Android. Some range checks were removed as the caller already checks them.
Philipp Wiesemann 5c43207f 2015-02-22T21:00:35 Emscripten: Fixed sending button and motion events for not opened joysticks. SDL_SYS_JoystickUpdate() was implemented incorrectly. For every call to it all attached joysticks were checked. But actually only the given SDL_Joystick should be checked then. This allowed sending broken events for attached but not opened joysticks. It also checked the opened joysticks more often than actually needed.
Ryan C. Gordon 20186815 2015-02-19T23:52:10 Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!). Fixes Bugzilla #2822.
Philipp Wiesemann 6dda14c0 2015-02-18T21:34:07 Emscripten: Fixed receiving joystick events after failed init or subsystem quit. The callbacks used to receive the HTML events were not removed if the joystick subsystem initialization failed or if the joystick subsystem was quit. Also, the already connected joysticks were not deleted if the initialization failed later.
Philipp Wiesemann 052720f7 2015-02-15T21:47:10 Emscripten: Removed unused internal function.
Philipp Wiesemann bd2d0146 2015-02-15T21:44:36 Emscripten: Changed return type of callback implementations from int to EM_BOOL. The prototypes are declared with EM_BOOL (which is currently an int) in html5.h.
Philipp Wiesemann 2ef8b1a7 2015-02-14T15:22:04 Emscripten: Fixed sending SDL_JOYDEVICEADDED events with an index out of range. SDL_JOYDEVICEADDED events must contain the device index which is a value between 0 and the number of connected joysticks. The old implementation included a value based on the instance id instead. It worked in some cases because the values are similar initially. But after disconnecting joysticks this is no more the case and the always increasing instance id becomes larger than number of joysticks.
Philipp Wiesemann 39418488 2015-02-14T15:16:41 Emscripten: Deactivated and corrected debug log messages on joystick events.
Philipp Wiesemann c5179c6a 2015-02-14T00:13:00 Emscripten: Fixed not including SDL_internal.h.
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
Philipp Wiesemann 86f87bf7 2015-01-31T22:45:54 Added missing guards in implementation for PSP. Thanks to Martin Gerhardy for pointing this out.
Philipp Wiesemann d036ad84 2015-01-31T22:43:05 Added missing include statements in implementation for PSP. SDL_internal.h should be included to support dynamic API and fix warnings.
Philipp Wiesemann f4b7cf6e 2015-01-31T21:02:56 Fixed including SDL_config.h in implementation for Android. SDL_internal.h should be included to support dynamic API.
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)
Sam Lantinga 0874eb97 2015-01-29T13:33:20 Add binding layout for Xbone pad.
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.
Alex Szpakowski 66867e65 2015-01-24T23:58:07 Merged default into iOS-improvements
Philipp Wiesemann 2b53ffc7 2015-01-16T23:07:10 Fixed wrong documentation in joystick implementation source.
Alex Szpakowski ea5d1a8a 2015-01-15T01:15:24 Merged default into iOS-improvements
Philipp Wiesemann f5fa9a59 2014-12-31T21:00:32 Removed unused enumeration and constant from internal header file.
Ryan C. Gordon 16f3cbfc 2014-12-26T23:16:54 Cleaned up some compiler warnings.
Philipp Wiesemann f4dcc246 2014-12-25T22:43:17 Changed Emscripten entry in gamecontroller database to allow sorting by script.
Philipp Wiesemann 79b3221b 2014-12-25T22:03:07 Fixed compile warnings about unused variables. Found by buildbot.
Ryan C. Gordon fe40a172 2014-12-18T00:19:52 Initial merge of Emscripten port! With this commit, you can compile SDL2 with Emscripten ( http://emscripten.org/ ), and make your SDL-based C/C++ program into a web app. This port was due to the efforts of several people, including: Charlie Birks, Sathyanarayanan Gunasekaran, Jukka Jyl?nki, Alon Zakai, Edward Rudd, Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)
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.
Alex Szpakowski 0b02de75 2014-11-15T22:59:16 Merged default into iOS-improvements
Philipp Wiesemann 37720dd5 2014-10-29T22:44:35 Fixed gamecontroller database sorting script not sorting the whole database. The script was originally written for an SDL_gamecontrollerdb.h which had groups of mappings separated by single lines starting with a "#". This was changed some time ago to #endif/#if pairs. Because the script assumed only a single #endif in the whole file it no longer worked correctly and only processed the first group.
Philipp Wiesemann 2bdc5c9d 2014-10-29T20:35:21 Updated gamecontroller database sorting script to work with Python 3.
Alex Szpakowski fb6d185a 2014-10-28T18:36:29 Merged default into iOS-improvements
Philipp Wiesemann 7268eabb 2014-10-26T23:28:45 Added handling of NULL as input for SDL_GameControllerAddMapping().
Philipp Wiesemann 33a2b58c 2014-10-26T23:22:53 Fixed SDL_GameControllerMappingForGUID() crashing if no more memory available. The return value of SDL_malloc() was not checked and NULL therefore not handled. NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID() now either means "no mapping" (as before) or "no memory" (just crashed before).
Philipp Wiesemann 30d6cec1 2014-10-26T17:53:16 Added handling of NULL as input for SDL_GameControllerMapping(). For consistency with the similar functions getting SDL_GameController as input. Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
Philipp Wiesemann 90387daf 2014-10-26T17:46:11 Removed two wrong documentation comments from gamecontroller source. No replacement because correct documentation is already in SDL_gamecontroller.h.
Philipp Wiesemann 0a053ed6 2014-10-26T17:44:00 Fixed wording in SDL_GameControllerAddMappingsFromRW() error message.
David Ludwig 1b341f58 2014-10-15T15:50:35 WinRT build fix
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
Alex Szpakowski 3071128d 2014-09-10T18:10:37 Merged default into iOS-improvements
Ryan C. Gordon 724d24d9 2014-08-31T11:21:10 Mac: Don't add the same joystick twice if IOKit reports a duplicate device. Fixes Bugzilla #2704.
Alex Szpakowski b1a0bd10 2014-08-20T17:20:22 Merged default into iOS-improvements
Sam Lantinga 4fe43f40 2014-08-11T17:24:54 Added an entry for the new Steam controller XInput emulation mode
Alex Szpakowski f5543f93 2014-08-06T03:24:16 Updated the iOS backend code to use Objective-C's automatic reference counting (ARC).
Alex Szpakowski caad673f 2014-07-29T00:36:12 Added missing autorelease pool blocks in UIKit backend code. Fixes memory leak issues, especially in SDL_video.
Alex Szpakowski c81ce5a0 2014-07-15T02:04:08 Minor fix for if SDL_JoystickInit is called more than once without a matching SDL_JoystickQuit.
Alex Szpakowski 1506b3b8 2014-07-15T02:01:43 iOS now respects SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
Sam Lantinga cd8f63f2 2014-07-07T13:21:54 Hopefully fixed Cygwin build
Sam Lantinga a2d5dd02 2014-07-07T13:19:53 Removed useless assert
Sam Lantinga fc4e798d 2014-07-07T12:48:25 Fixed bug 2631 - Mac: minor code cleanup Alex Szpakowski Some minor changes to the Mac-specific backend code: - Fixed up some code style issues (mostly brace style inconsistencies). - Fixed a compiler warning in SDL_cocoaevents.m. - Removed some useless code now that the 10.7 SDK is required to build SDL. - Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
Sam Lantinga febc4797 2014-07-07T11:44:14 SDL_SYS_IsXInputGamepad_DeviceIndex() is only available if SDL_JOYSTICK_XINPUT is true.
Sam Lantinga 1ee96bb9 2014-07-07T10:26:28 Fixed mingw64 build and warnings
Sam Lantinga b79e7f32 2014-07-03T15:39:55 Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
David Ludwig 65023e07 2014-06-25T22:38:40 WinRT: Fixed game controller axis mappings SDL/WinRT currently uses a separate XInput backend from SDL/Win32, as WinRT has no support for DirectInput. This change makes SDL/WinRT's XInput code snag some recently-changed bits from the Win32-specific, DirectInput + XInput backend, in order to get the SDL_GameController API working again on WinRT, insofar that axes map to the correct parts. TODO: - test all buttons, making sure WinRT maps buttons the same way that Win32 does - consider making the Win32 and WinRT codebases share more stuff, minus the sort of duplication happening via this change. Maybe simulate, or stub-out, DirectInput calls when on WinRT?
David Ludwig a838a56d 2014-06-25T22:03:05 WinRT build fix
Sam Lantinga 6a632eb2 2014-06-25T00:20:21 Fixed bug 2603 - iOS: update joystick accelerometer code to use CoreMotion instead of the deprecated UIAccelerometer Alex Szpakowski SDL's code for exposing the accelerometer as a joystick on iOS currently uses UIAccelerometer, which was superseded by the CoreMotion framework and deprecated since iOS 5. The UIAccelerometer code still works (for now), but it also throws deprecation warnings whenever SDL is built for iOS, since SDL's deployment target is no longer below iOS 5. I've created a patch which replaces the old UIAccelerometer code with a replacement based on the CoreMotion framework. It has identical functionality (to SDL users), however iOS apps are now required to link to the CoreMotion framework when using SDL.
Sam Lantinga 52ec151f 2014-06-24T13:31:25 Fixed bug 2553 - Add support to all XInput devices This adds support for all XInput devices, exposed through the SDL joystick API. The button and axis reporting for XInput devices has been changed to match DirectInput and other platforms. The game controller xinput mapping has been updated so this change is seamless. There is a new hint, SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, for any applications that have hardcoded the old xinput button and axis set. This hint will be removed in SDL 2.1.
Sam Lantinga 7b7828a4 2014-06-21T21:30:49 You shouldn't get axis and hat events when your application doesn't have focus (unless you use the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint)
Sam Lantinga 54771080 2014-06-15T13:05:30 Add controller mapping for Bluetooth DualShock 4 controllers on Linux Frank Praznik Add a gamepad mapping entry for Bluetooth DualShock 4 controllers on Linux. The button mapping is the same as the USB controller, but the GUID is different.
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.
Ryan C. Gordon 9e5504f8 2014-06-13T14:52:26 Mac: Run the CFRunLoop in joystick mode during SDL_SYS_JoystickNeedsPolling(). This fixes hotplugging failing to detect devices.
Alfred Reynolds 8c2c744a 2014-06-13T10:50:24 - fixed crash if you removed a device twice, the deviceRef is invalid if removed from the removed device callback (added in http://hg.libsdl.org/SDL/rev/d4e4d0fcda03 ).
Sam Lantinga da6d9a9f 2014-06-04T10:56:56 Added annotations to help code analysis tools CR: Bruce Dawson
Sam Lantinga e772f0df 2014-05-13T12:10:37 Added a binding for the NVIDIA Shield controller
Sam Lantinga 67350973 2014-05-13T11:32:36 Updated coding style to match the rest of SDL
Ryan C. Gordon 5d7562c7 2014-04-24T23:24:48 Mac OS X: Look for joystick hotplug in its own CFRunLoop. This allows the joystick hotplug to function without the main event loop (specifically: without SDL_INIT_VIDEO), and moves explicit polling for joysticks where it belongs at the low-level: in SDL_SYS_JoystickDetect(). This lets apps call SDL_JoystickUpdate() to get hotplug events and keep SDL_NumJoysticks() correct, as expected. As SDL_PumpEvents() (and SDL_PollEvents, etc) calls SDL_JoystickUpdate(), existing apps will function as before. Thanks to "raskie" on the forums for pointing this out!
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 c3c24a33 2014-03-31T10:38:26 Fixed the joystick side of XInput haptic detection on Windows 8
Ryan C. Gordon 2a2fb611 2014-03-18T12:53:01 Fixed PS4 game controller config on Windows.
Ryan C. Gordon 978566a6 2014-03-18T12:52:51 Whitespace fix.
Ryan C. Gordon 7eaf8997 2014-03-17T19:11:18 Fixed SDL_HapticOpenFromJoystick() with DirectInput devices.
Sam Lantinga ed02f61d 2014-03-13T00:40:08 Fixed the copyright date on files contributed by David Ludwig
Sam Lantinga 641ba099 2014-03-12T07:26:07 Fixed compiling Windows RT code on Visual Studio 2013
Sam Lantinga 1367bf87 2014-03-09T11:36:47 Integrated David Ludwig's support for Windows RT
Sam Lantinga 05c23063 2014-03-09T11:06:11 Fixed line endings on WinRT source code
Ryan C. Gordon 754067db 2014-03-01T22:27:21 Added a FIXME.
Ryan C. Gordon 7fa4eece 2014-03-01T22:27:13 Fixed a typo in a comment.
Ryan C. Gordon 73936208 2014-03-01T20:59:43 Added some FIXMEs.
Sam Lantinga 63106e47 2014-03-01T12:21:15 Changed SDL_HINT_ACCEL_AS_JOY to SDL_HINT_ACCELEROMETER_AS_JOYSTICK to be more clear.
Sam Lantinga ab9345a8 2014-02-28T16:24:41 Null termnate the pUserMappings variable to prevent memory corruption.
Gabriel Jacobo 2ed47d83 2014-02-24T10:00:10 Fixes #2417, memory leak in SDL_gamecontroller.c (thanks Leonardo!)
Ryan C. Gordon 96f09df7 2014-02-23T01:24:46 Free the correct variable.
Ryan C. Gordon f9f2bc5a 2014-02-22T21:21:33 Fixed Mac DualShock 4 gamecontroller db entry again.
Ryan C. Gordon b67b970d 2014-02-22T21:15:34 Mac joystick: ignore duplicate HID elements. The DualShock 4 has all elements listed twice: once in the top-level list of elements, and once in an "Application Collection" element at the top-level. Each element has a proper cookie with a unique value, so now we descend into each element collections, but before we add an element to the device's list, we make sure we don't already have one with that cookie, probably from another collection or a buggy device.
Ryan C. Gordon 0deb54c0 2014-02-22T00:55:28 Reworked Mac OS X joystick code to use the 10.5+ HID Manager API. Besides being a little more simple to use than the earlier IOKit HID API, and less likely to be deprecated, it also has the added benefit of working with the Sony DualShock 4 controller in Bluetooth mode out of the box, whereas the previous API has a bug that makes it report bad data for the controller. Cleaned up several other things in this code, having gone over every line of it. The remaining deprecated calls are also gone.
Sam Lantinga 441f7d8d 2014-02-14T11:38:59 Fixed Mac PS4 controller entry, added Linux OUYA controller entry
Ryan C. Gordon f38c1f05 2014-02-10T12:47:26 Fixed DualShock 4 controller config on Mac OS X.