src/joystick/virtual/SDL_virtualjoystick.c


Log

Author Commit Date CI Message
Sam Lantinga 47f1cb55 2022-05-18T23:48:15 Fixed picking up the correct mapping for virtual controllers on Android Fixes https://github.com/libsdl-org/SDL/issues/5662
Sam Lantinga 1f2a2416 2022-05-16T09:02:35 Add new virtual joysticks to the end of the list This guarantees that the device index that's returned is stable, as long as no joystick hotplug events occur.
Sam Lantinga 3c3ccb1d 2022-05-16T08:55:54 Fixed crash if a virtual joystick was disconnected
Sam Lantinga f0bc5c9c 2022-05-16T07:21:28 Added effects support for virtual controllers
Sam Lantinga b3a18706 2022-05-16T06:37:38 Removed unused variables
Sam Lantinga 7e005bd8 2022-05-16T06:22:18 Fixed mapping the paddle buttons with the virtual controller
Sam Lantinga bfac54b5 2022-05-15T20:33:28 Added the ability to specify which buttons and axes are present for virtual controllers
Sam Lantinga 94eeb587 2022-05-15T20:01:12 First pass at extending virtual controller functionality Added the ability to specify a name and the product VID/PID for a virtual controller Also added a test case to testgamecontroller, if you pass --virtual as a parameter
Sam Lantinga 7ad15c5b 2022-05-15T09:35:52 Added game controller support for virtual joysticks Fixes https://github.com/libsdl-org/SDL/issues/5662
Sam Lantinga e551384a 2022-04-26T14:54:14 Added functions to get the platform dependent name for a joystick or game controller
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Cameron Gutman 1ccfbf96 2021-11-11T11:13:08 joystick: Convert HasLED() into a generic GetCapabilities() function
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
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>
Ozkan Sezer 6393d14d 2021-01-19T15:50:28 SDL_virtualjoystick.c: remove wrong #endif comment.
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
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 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.
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.
David Ludwig 8cd08646 2020-03-16T17:19:18 virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038)
David Ludwig b2296506 2020-03-15T15:05:36 virtual joysticks: MSVC support part 1/2, make driver's .c file be uniquely named