Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | testgamecontroller: log which controller the event came from | Sam Lantinga | 2021-01-13 | 1 | -4/+6 |
| | |||||
* | Updated copyright for 2021 | Sam Lantinga | 2021-01-02 | 1 | -1/+1 |
| | |||||
* | Enable PS5 enhanced functionality for testgamecontroller | Sam Lantinga | 2020-12-22 | 1 | -0/+1 |
| | |||||
* | Set the pad lights on the PS5 controller corresponding to the player index | Sam Lantinga | 2020-12-22 | 1 | -0/+8 |
| | | | | Also allow setting the player index from testgamecontroller using the number keys | ||||
* | Allow background input when testing game controllers | Sam Lantinga | 2020-12-04 | 1 | -0/+1 |
| | |||||
* | Remember to close the game controller when we're done with it | Sam Lantinga | 2020-11-27 | 1 | -0/+2 |
| | |||||
* | Open and test all connected controllers | Sam Lantinga | 2020-11-27 | 1 | -71/+155 |
| | |||||
* | Some controllers don't always reset their triggers to zero when they are ↵ | Sam Lantinga | 2020-11-25 | 1 | -6/+8 |
| | | | | released (e.g. Xbox One S in Bluetooth mode), so only trigger rumble if the trigger is pulled halfway or more. | ||||
* | Automatically switch to testing a new controller when it's plugged in | Sam Lantinga | 2020-11-24 | 1 | -8/+10 |
| | |||||
* | Allow testing a specific controller | Sam Lantinga | 2020-11-23 | 1 | -0/+4 |
| | |||||
* | Allow testing effects on PS4 controllers | Sam Lantinga | 2020-11-21 | 1 | -0/+1 |
| | | | | Note, this will switch the controller into advanced report mode which breaks DirectInput on Windows | ||||
* | Added API for sensors on game controllers | Sam Lantinga | 2020-11-17 | 1 | -19/+54 |
| | | | | | | 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 | ||||
* | Added SDL_JoystickGetSerial() and SDL_GameControllerGetSerial() | Sam Lantinga | 2020-11-16 | 1 | -1/+7 |
| | |||||
* | Improve LED color calculation, don't set LED unless left thumbstick is moved | Sam Lantinga | 2020-11-16 | 1 | -5/+22 |
| | |||||
* | Added support for the touchpad on PS4 and PS5 controllers | Sam Lantinga | 2020-11-13 | 1 | -1/+17 |
| | |||||
* | Fixed overflow in trigger rumble calculation | Sam Lantinga | 2020-11-12 | 1 | -1/+1 |
| | |||||
* | Added SDL_JoystickRumbleTriggers() and SDL_GameControllerRumbleTriggers() | Sam Lantinga | 2020-11-11 | 1 | -0/+21 |
| | |||||
* | Be explicit about mapping the new game controller paddle buttons | Sam Lantinga | 2020-11-07 | 1 | -48/+62 |
| | |||||
* | Don't try to map the accelerometer as a game controller | Sam Lantinga | 2020-11-06 | 1 | -0/+2 |
| | |||||
* | iOS should use the same size window for the controller tests as other platforms | Sam Lantinga | 2020-11-06 | 1 | -5/+0 |
| | | | | Otherwise the position of the button and axis elements won't be correct | ||||
* | Added 4 auxiliary buttons to the game controller API | Sam Lantinga | 2020-11-06 | 1 | -0/+4 |
| | | | | | | 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 | ||||
* | Added SDL_JoystickHasLED | Sam Lantinga | 2020-11-05 | 1 | -0/+12 |
| | | | | Currently, this is only supported by the PS4 HIDAPI driver. | ||||
* | Added a Windows Gaming Input joystick driver | Sam Lantinga | 2020-04-18 | 1 | -161/+119 |
| | | | | | | | | | 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 | ||||
* | Removed debug code | Sam Lantinga | 2020-04-08 | 1 | -2/+0 |
| | |||||
* | Fixed memory leak and removed debug code from Windows sensor implementation | Sam Lantinga | 2020-04-08 | 1 | -0/+2 |
| | |||||
* | Fixed bug 5028 - Virtual Joysticks (new joystick backend) | Sam Lantinga | 2020-03-13 | 1 | -0/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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! | ||||
* | Use the triggers to test rumble for more fine grained vibration feedback | Sam Lantinga | 2020-02-07 | 1 | -5/+7 |
| | |||||
* | Updated copyright date for 2020 | Sam Lantinga | 2020-01-16 | 1 | -1/+1 |
| | |||||
* | Automatically assign player indexes to game controllers, and allow changing ↵ | Sam Lantinga | 2019-12-20 | 1 | -2/+2 |
| | | | | | | the player index for game controllers and joysticks. Added the functions SDL_JoystickFromPlayerIndex(), SDL_JoystickSetPlayerIndex(), SDL_GameControllerFromPlayerIndex(), and SDL_GameControllerSetPlayerIndex() | ||||
* | Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to ↵ | Sam Lantinga | 2019-11-22 | 1 | -1/+20 |
| | | | | return the type of controller attached. | ||||
* | test: replace some exit()s with returns. | Ozkan Sezer | 2019-09-10 | 1 | -1/+1 |
| | |||||
* | Updated copyright for 2019 | Sam Lantinga | 2019-01-04 | 1 | -1/+1 |
| | |||||
* | Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and ↵ | Sam Lantinga | 2018-08-09 | 1 | -0/+5 |
| | | | | | | Nintendo Switch Pro controller support across platforms. Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API | ||||
* | Updated copyright for 2018 | Sam Lantinga | 2018-01-03 | 1 | -1/+1 |
| | |||||
* | Updated copyright for 2017 | Sam Lantinga | 2017-01-01 | 1 | -1/+1 |
| | |||||
* | Fixed compiling of testgamecontroller program with C++. | Philipp Wiesemann | 2016-12-28 | 1 | -2/+2 |
| | |||||
* | Split controller axes into positive and negative sides so each can be bound ↵ | Sam Lantinga | 2016-12-27 | 1 | -10/+13 |
| | | | | | | | independently. Using this a D-Pad can be mapped to a thumbstick and vice versa. Also added support for inverted axes, improving trigger binding support | ||||
* | Only print out the controller mappings if we're not going to test a controller | Sam Lantinga | 2016-12-09 | 1 | -7/+9 |
| | |||||
* | Added an API to iterate over game controller mappings | Sam Lantinga | 2016-11-29 | 1 | -0/+11 |
| | |||||
* | Added USB VID/PID information to the SDL test programs | Sam Lantinga | 2016-11-10 | 1 | -1/+5 |
| | |||||
* | Fixed black screen on Steam Link | Sam Lantinga | 2016-10-13 | 1 | -1/+1 |
| | |||||
* | Fixed compiling of three test programs with C++. | Philipp Wiesemann | 2016-09-21 | 1 | -4/+4 |
| | |||||
* | Fixed memory leak in game controller test program. | Philipp Wiesemann | 2016-05-05 | 1 | -0/+2 |
| | |||||
* | Updated copyright to 2016 | Sam Lantinga | 2016-01-02 | 1 | -1/+1 |
| | |||||
* | Replaced tabs with spaces in test programs. | Philipp Wiesemann | 2015-11-25 | 1 | -2/+2 |
| | |||||
* | Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID(). | Ryan C. Gordon | 2015-11-14 | 1 | -0/+8 |
| | |||||
* | Added initial support for MFi game controllers on iOS. | Alex Szpakowski | 2015-09-20 | 1 | -2/+2 |
| | |||||
* | Updated the copyright year to 2015 | Sam Lantinga | 2015-05-26 | 1 | -1/+1 |
| | |||||
* | Removed redundant NULL check in test program. | Philipp Wiesemann | 2015-05-21 | 1 | -4/+2 |
| | |||||
* | Added missing loop cancel for Emscripten in test programs. | Philipp Wiesemann | 2015-05-18 | 1 | -0/+6 |
| |