86 Commits

Author SHA1 Message Date
Sam Lantinga
2b5b8fdbd5 Updated copyright for 2025 2025-01-01 07:47:53 -08:00
SDL Wiki Bot
96e7306a7a Sync SDL2 wiki -> header
[ci skip]
2024-10-27 21:41:54 +00:00
Jordan Christiansen
a22baafcf4 docs: Explain events for already plugged in controllers 2024-10-27 14:41:06 -07:00
SDL Wiki Bot
744eb00b04 Sync SDL2 wiki -> header 2024-06-16 15:02:26 +00:00
SDL Wiki Bot
143d5d779c Sync SDL2 wiki -> header 2024-06-14 06:11:54 +00:00
Ryan C. Gordon
1c3a1e1139 wikiheaders: Updated to latest, cleaned up category documentation a little.
This documentation needs a LOT of work--maybe someday--but it's definitely not
_broken_ right now, which is good enough for now.
2024-05-16 11:49:21 -04:00
Ryan C. Gordon
0805990668 wikiheaders: Automatically categorize API symbols by subsystem. 2024-05-14 10:50:37 -04:00
Ryan C. Gordon
e03ad30a57 docs: heavy editing to make this happy with latest wikibridge.
The public headers saw lots of cleanups, backporting from SDL3 docs, and
merging with the wiki.

The markdown files in docs/README-*.md were converted to Unix endlines.
2024-04-23 14:21:54 -04:00
Ryan C. Gordon
623a83f2b5 Sync wiki -> SDL2. 2024-04-23 10:00:05 -04:00
Ryan C. Gordon
e75d72670f include: Fixes to make the headers friendly with the latest wikiheaders. 2024-04-11 01:17:27 -04:00
Simon McVittie
b1a82b5772 gamecontroller: Fix function name in cherry-picked documentation
SDL_GetGamepadAxis() is a SDL3-specific name: SDL2 calls gamepads
"game controllers".

Fixes: d3c21666 "gamepad: Clarify range and direction of axes"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 11:09:55 -08:00
Sam Lantinga
d3c21666de gamepad: Clarify range and direction of axes
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.

We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).

Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>

(cherry picked from commit 059fb560ba)
2024-01-08 09:48:04 -08:00
Sam Lantinga
0fc3574464 Updated copyright for 2024 2024-01-01 13:19:49 -08:00
Sam Lantinga
7bb0e839a6 Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GameControllerGetSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_CONTROLLERSTEAMHANDLEUPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.

(cherry picked from commit c981a597dc)
2023-12-20 13:29:57 -08:00
Ethan Lee
757c984ddb gamecontroller: Backport 3.0 'type:' field to 2.0 2023-11-30 14:42:56 -08:00
Sam Lantinga
0479df53ca Updated copyright for 2023 2023-01-09 09:48:21 -08:00
Sam Lantinga
c2b2f2a71e Clarified where the paddle locations are
(cherry picked from commit ea714956b6)
2022-12-07 14:47:07 -08:00
SDL Wiki Bot
11a24a34e3 Sync SDL wiki -> header 2022-10-26 22:30:06 +00:00
SDL Wiki Bot
393acf6362 Sync SDL wiki -> header 2022-10-25 18:07:13 +00:00
SDL Wiki Bot
4ca86dae2f Sync SDL wiki -> header 2022-10-05 23:26:14 +00:00
SDL Wiki Bot
36e7670143 Sync SDL wiki -> header 2022-09-27 16:57:17 +00:00
Sam Lantinga
2c518747b9 Added microsecond timestamp to sensor values for PS4 and PS5 controllers using the HIDAPI driver 2022-09-27 09:56:49 -07:00
SDL Wiki Bot
523bedac1a Sync SDL wiki -> header 2022-08-09 15:48:12 +00:00
Sam Lantinga
aad2df7f0d Document passing -1 to clear the player index for a controller 2022-08-09 08:47:49 -07:00
Sam Lantinga
878259722f Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers 2022-08-08 08:22:20 -07:00
Cameron Gutman
6e712d2440 joystick: Add HIDAPI driver for NVIDIA SHIELD 2017 controller
Basic input already works using the OS HID driver, but this enables
force feedback and battery state reporting.
2022-07-10 10:53:26 -07:00
Sam Lantinga
423141bfca Added a function to get the controller firmware version 2022-06-03 18:50:00 -07:00
SDL Wiki Bot
5953422c09 Sync wiki -> header 2022-05-16 03:52:04 +00:00
Sam Lantinga
e551384a99 Added functions to get the platform dependent name for a joystick or game controller 2022-04-26 14:54:14 -07:00
SDL Wiki Bot
232c3556ac Sync wiki -> header 2022-03-04 17:30:05 +00:00
Sam Lantinga
ae73ea9c07 Clarified documentation for the trigger rumble API
Fixes https://github.com/libsdl-org/SDL/issues/5372
2022-03-04 09:27:46 -08:00
Sam Lantinga
120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL Wiki Bot
cfbae8b967 Sync wiki -> header 2021-11-11 23:12:04 +00:00
Cameron Gutman
fe09a4930a joystick: Add APIs to query rumble support 2021-11-11 15:10:08 -08:00
Ryan C. Gordon
b42ae3dbfe Sync wiki -> header 2021-11-10 15:21:01 -05:00
Sam Lantinga
74f35a7cbd Fixed documentation 2021-11-07 14:10:04 -08:00
Sam Lantinga
e14358265e Cleanup sfSymbolName support and add them to the dynamic API functions 2021-11-07 11:16:48 -08:00
Patrick Hogan
149e5c656a Support returning sfSymbolsName for gamepad controls on macOS / iOS / tvOS 2021-11-07 10:58:37 -08:00
SDL Wiki Bot
c7dafb1556 Sync wiki -> header 2021-10-27 01:36:05 +00:00
SDL Wiki Bot
192538357b Sync wiki -> header 2021-09-17 19:14:05 +00:00
SDL Wiki Bot
72ee0ccdd5 Sync wiki -> header 2021-07-29 13:46:05 +00:00
Sam Lantinga
a186a503e7 Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller. 2021-07-29 06:43:39 -07:00
Sam Lantinga
94b7a87645 Added SDL_GameControllerType enumerations for the Amazon Luna and Google Stadia controllers
Fixes bug https://github.com/libsdl-org/SDL/issues/4019
2021-07-24 09:10:18 -07:00
SDL Wiki Bot
7edffc5798 Sync wiki -> header 2021-07-23 18:29:04 +00:00
SDL Wiki Bot
c06448fe39 Sync wiki -> header 2021-07-23 16:39:05 +00:00
Ryan C. Gordon
c88eb7a896 Sync wiki -> header. 2021-07-14 17:07:04 -04:00
Ryan C. Gordon
f8c1fc49d9 doxygen: Fix all the "\returns" so they work as part of complete sentences. 2021-07-14 14:15:30 -04:00
Ryan C. Gordon
04196a46a5 doxygen: wrap some game controller code examples in "```c" blocks. 2021-07-14 11:03:00 -04:00
Sam Lantinga
d135c0762f 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
2021-07-08 13:22:41 -07:00
Dimitriy Ryazantcev
17ed8d8085 Added HIDAPI backend for Amazon Luna Controller Model T28B69 connected via Bluetooth LE (VID:0171, PID:0419).
To enter Bluetooth pairing mode hold B and Action (button with circle) buttons for 3 seconds.

It works via usual HIDAPI if special filter driver is not installed:
https://www.amazon.com/gp/help/customer/display.html?nodeId=GZCT4CTFHXLHEB9T

With that driver installed it mimics Xbox One controller and works via XInput under Windows.

Under DInput this controller is not usable at all.
2021-07-07 08:31:12 -07:00