SDL 2.0
SDL_gamecontroller.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/* WIKI CATEGORY: GameController */
23
24/**
25 * # CategoryGameController
26 *
27 * Include file for SDL game controller event handling
28 */
29
30#ifndef SDL_gamecontroller_h_
31#define SDL_gamecontroller_h_
32
33#include "SDL_stdinc.h"
34#include "SDL_error.h"
35#include "SDL_rwops.h"
36#include "SDL_sensor.h"
37#include "SDL_joystick.h"
38
39#include "begin_code.h"
40/* Set up for C function definitions, even when using C++ */
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/**
46 * \file SDL_gamecontroller.h
47 *
48 * In order to use these functions, SDL_Init() must have been called
49 * with the SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
50 * for game controllers, and load appropriate drivers.
51 *
52 * If you would like to receive controller updates while the application
53 * is in the background, you should set the following hint before calling
54 * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
55 */
56
57/**
58 * The gamecontroller structure used to identify an SDL game controller
59 */
60struct _SDL_GameController;
61typedef struct _SDL_GameController SDL_GameController;
62
81
89
90/**
91 * Get the SDL joystick layer binding for this controller button/axis mapping
92 */
107
108
109/**
110 * To count the number of game controllers in the system for the following:
111 *
112 * ```c
113 * int nJoysticks = SDL_NumJoysticks();
114 * int nGameControllers = 0;
115 * for (int i = 0; i < nJoysticks; i++) {
116 * if (SDL_IsGameController(i)) {
117 * nGameControllers++;
118 * }
119 * }
120 * ```
121 *
122 * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
123 * guid,name,mappings
124 *
125 * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
126 * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
127 * The mapping format for joystick is:
128 * bX - a joystick button, index X
129 * hX.Y - hat X with value Y
130 * aX - axis X of the joystick
131 * Buttons can be used as a controller axis and vice versa.
132 *
133 * This string shows an example of a valid mapping for a controller
134 *
135 * ```c
136 * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
137 * ```
138 */
139
140/**
141 * Load a set of Game Controller mappings from a seekable SDL data stream.
142 *
143 * You can call this function several times, if needed, to load different
144 * database files.
145 *
146 * If a new mapping is loaded for an already known controller GUID, the later
147 * version will overwrite the one currently loaded.
148 *
149 * If this function is called before SDL_Init, SDL will generate an
150 * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
151 * in at the time that SDL_Init is called.
152 *
153 * Mappings not belonging to the current platform or with no platform field
154 * specified will be ignored (i.e. mappings for Linux will be ignored in
155 * Windows, etc).
156 *
157 * This function will load the text database entirely in memory before
158 * processing it, so take this into consideration if you are in a memory
159 * constrained environment.
160 *
161 * \param rw the data stream for the mappings to be added.
162 * \param freerw non-zero to close the stream after being read.
163 * \returns the number of mappings added or -1 on error; call SDL_GetError()
164 * for more information.
165 *
166 * \since This function is available since SDL 2.0.2.
167 *
168 * \sa SDL_GameControllerAddMapping
169 * \sa SDL_GameControllerAddMappingsFromFile
170 * \sa SDL_GameControllerMappingForGUID
171 * \sa SDL_CONTROLLERDEVICEADDED
172 */
173extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
174
175/**
176 * Load a set of mappings from a file, filtered by the current
177 * SDL_GetPlatform()
178 *
179 * Convenience macro.
180 */
181#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
182
183/**
184 * Add support for controllers that SDL is unaware of or to cause an existing
185 * controller to have a different binding.
186 *
187 * The mapping string has the format "GUID,name,mapping", where GUID is the
188 * string value from SDL_JoystickGetGUIDString(), name is the human readable
189 * string for the device and mappings are controller mappings to joystick
190 * ones. Under Windows there is a reserved GUID of "xinput" that covers all
191 * XInput devices. The mapping format for joystick is: {| |bX |a joystick
192 * button, index X |- |hX.Y |hat X with value Y |- |aX |axis X of the joystick
193 * |} Buttons can be used as a controller axes and vice versa.
194 *
195 * This string shows an example of a valid mapping for a controller:
196 *
197 * ```c
198 * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
199 * ```
200 *
201 * If this function is called before SDL_Init, SDL will generate an
202 * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
203 * in at the time that SDL_Init is called.
204 *
205 * \param mappingString the mapping string.
206 * \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
207 * -1 on error; call SDL_GetError() for more information.
208 *
209 * \since This function is available since SDL 2.0.0.
210 *
211 * \sa SDL_GameControllerMapping
212 * \sa SDL_GameControllerMappingForGUID
213 * \sa SDL_CONTROLLERDEVICEADDED
214 */
215extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
216
217/**
218 * Get the number of mappings installed.
219 *
220 * \returns the number of mappings.
221 *
222 * \since This function is available since SDL 2.0.6.
223 */
224extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
225
226/**
227 * Get the mapping at a particular index.
228 *
229 * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
230 * the index is out of range.
231 *
232 * \since This function is available since SDL 2.0.6.
233 */
234extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
235
236/**
237 * Get the game controller mapping string for a given GUID.
238 *
239 * The returned string must be freed with SDL_free().
240 *
241 * \param guid a structure containing the GUID for which a mapping is desired.
242 * \returns a mapping string or NULL on error; call SDL_GetError() for more
243 * information.
244 *
245 * \since This function is available since SDL 2.0.0.
246 *
247 * \sa SDL_JoystickGetDeviceGUID
248 * \sa SDL_JoystickGetGUID
249 */
250extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
251
252/**
253 * Get the current mapping of a Game Controller.
254 *
255 * The returned string must be freed with SDL_free().
256 *
257 * Details about mappings are discussed with SDL_GameControllerAddMapping().
258 *
259 * \param gamecontroller the game controller you want to get the current
260 * mapping for.
261 * \returns a string that has the controller's mapping or NULL if no mapping
262 * is available; call SDL_GetError() for more information.
263 *
264 * \since This function is available since SDL 2.0.0.
265 *
266 * \sa SDL_GameControllerAddMapping
267 * \sa SDL_GameControllerMappingForGUID
268 */
269extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
270
271/**
272 * Check if the given joystick is supported by the game controller interface.
273 *
274 * `joystick_index` is the same as the `device_index` passed to
275 * SDL_JoystickOpen().
276 *
277 * \param joystick_index the device_index of a device, up to
278 * SDL_NumJoysticks().
279 * \returns SDL_TRUE if the given joystick is supported by the game controller
280 * interface, SDL_FALSE if it isn't or it's an invalid index.
281 *
282 * \since This function is available since SDL 2.0.0.
283 *
284 * \sa SDL_GameControllerNameForIndex
285 * \sa SDL_GameControllerOpen
286 */
287extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
288
289/**
290 * Get the implementation dependent name for the game controller.
291 *
292 * This function can be called before any controllers are opened.
293 *
294 * `joystick_index` is the same as the `device_index` passed to
295 * SDL_JoystickOpen().
296 *
297 * \param joystick_index the device_index of a device, from zero to
298 * SDL_NumJoysticks()-1.
299 * \returns the implementation-dependent name for the game controller, or NULL
300 * if there is no name or the index is invalid.
301 *
302 * \since This function is available since SDL 2.0.0.
303 *
304 * \sa SDL_GameControllerName
305 * \sa SDL_GameControllerOpen
306 * \sa SDL_IsGameController
307 */
308extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
309
310/**
311 * Get the implementation dependent path for the game controller.
312 *
313 * This function can be called before any controllers are opened.
314 *
315 * `joystick_index` is the same as the `device_index` passed to
316 * SDL_JoystickOpen().
317 *
318 * \param joystick_index the device_index of a device, from zero to
319 * SDL_NumJoysticks()-1.
320 * \returns the implementation-dependent path for the game controller, or NULL
321 * if there is no path or the index is invalid.
322 *
323 * \since This function is available since SDL 2.24.0.
324 *
325 * \sa SDL_GameControllerPath
326 */
327extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index);
328
329/**
330 * Get the type of a game controller.
331 *
332 * This can be called before any controllers are opened.
333 *
334 * \param joystick_index the device_index of a device, from zero to
335 * SDL_NumJoysticks()-1.
336 * \returns the controller type.
337 *
338 * \since This function is available since SDL 2.0.12.
339 */
340extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
341
342/**
343 * Get the mapping of a game controller.
344 *
345 * This can be called before any controllers are opened.
346 *
347 * \param joystick_index the device_index of a device, from zero to
348 * SDL_NumJoysticks()-1.
349 * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
350 * no mapping is available.
351 *
352 * \since This function is available since SDL 2.0.9.
353 */
354extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
355
356/**
357 * Open a game controller for use.
358 *
359 * `joystick_index` is the same as the `device_index` passed to
360 * SDL_JoystickOpen().
361 *
362 * The index passed as an argument refers to the N'th game controller on the
363 * system. This index is not the value which will identify this controller in
364 * future controller events. The joystick's instance id (SDL_JoystickID) will
365 * be used there instead.
366 *
367 * \param joystick_index the device_index of a device, up to
368 * SDL_NumJoysticks().
369 * \returns a gamecontroller identifier or NULL if an error occurred; call
370 * SDL_GetError() for more information.
371 *
372 * \since This function is available since SDL 2.0.0.
373 *
374 * \sa SDL_GameControllerClose
375 * \sa SDL_GameControllerNameForIndex
376 * \sa SDL_IsGameController
377 */
378extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
379
380/**
381 * Get the SDL_GameController associated with an instance id.
382 *
383 * \param joyid the instance id to get the SDL_GameController for.
384 * \returns an SDL_GameController on success or NULL on failure; call
385 * SDL_GetError() for more information.
386 *
387 * \since This function is available since SDL 2.0.4.
388 */
390
391/**
392 * Get the SDL_GameController associated with a player index.
393 *
394 * Please note that the player index is _not_ the device index, nor is it the
395 * instance id!
396 *
397 * \param player_index the player index, which is not the device index or the
398 * instance id!
399 * \returns the SDL_GameController associated with a player index.
400 *
401 * \since This function is available since SDL 2.0.12.
402 *
403 * \sa SDL_GameControllerGetPlayerIndex
404 * \sa SDL_GameControllerSetPlayerIndex
405 */
406extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
407
408/**
409 * Get the implementation-dependent name for an opened game controller.
410 *
411 * This is the same name as returned by SDL_GameControllerNameForIndex(), but
412 * it takes a controller identifier instead of the (unstable) device index.
413 *
414 * \param gamecontroller a game controller identifier previously returned by
415 * SDL_GameControllerOpen().
416 * \returns the implementation dependent name for the game controller, or NULL
417 * if there is no name or the identifier passed is invalid.
418 *
419 * \since This function is available since SDL 2.0.0.
420 *
421 * \sa SDL_GameControllerNameForIndex
422 * \sa SDL_GameControllerOpen
423 */
424extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
425
426/**
427 * Get the implementation-dependent path for an opened game controller.
428 *
429 * This is the same path as returned by SDL_GameControllerNameForIndex(), but
430 * it takes a controller identifier instead of the (unstable) device index.
431 *
432 * \param gamecontroller a game controller identifier previously returned by
433 * SDL_GameControllerOpen().
434 * \returns the implementation dependent path for the game controller, or NULL
435 * if there is no path or the identifier passed is invalid.
436 *
437 * \since This function is available since SDL 2.24.0.
438 *
439 * \sa SDL_GameControllerPathForIndex
440 */
441extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller);
442
443/**
444 * Get the type of this currently opened controller
445 *
446 * This is the same name as returned by SDL_GameControllerTypeForIndex(), but
447 * it takes a controller identifier instead of the (unstable) device index.
448 *
449 * \param gamecontroller the game controller object to query.
450 * \returns the controller type.
451 *
452 * \since This function is available since SDL 2.0.12.
453 */
455
456/**
457 * Get the player index of an opened game controller.
458 *
459 * For XInput controllers this returns the XInput user index.
460 *
461 * \param gamecontroller the game controller object to query.
462 * \returns the player index for controller, or -1 if it's not available.
463 *
464 * \since This function is available since SDL 2.0.9.
465 */
466extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
467
468/**
469 * Set the player index of an opened game controller.
470 *
471 * \param gamecontroller the game controller object to adjust.
472 * \param player_index Player index to assign to this controller, or -1 to
473 * clear the player index and turn off player LEDs.
474 *
475 * \since This function is available since SDL 2.0.12.
476 */
477extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
478
479/**
480 * Get the USB vendor ID of an opened controller, if available.
481 *
482 * If the vendor ID isn't available this function returns 0.
483 *
484 * \param gamecontroller the game controller object to query.
485 * \return the USB vendor ID, or zero if unavailable.
486 *
487 * \since This function is available since SDL 2.0.6.
488 */
489extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
490
491/**
492 * Get the USB product ID of an opened controller, if available.
493 *
494 * If the product ID isn't available this function returns 0.
495 *
496 * \param gamecontroller the game controller object to query.
497 * \return the USB product ID, or zero if unavailable.
498 *
499 * \since This function is available since SDL 2.0.6.
500 */
501extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
502
503/**
504 * Get the product version of an opened controller, if available.
505 *
506 * If the product version isn't available this function returns 0.
507 *
508 * \param gamecontroller the game controller object to query.
509 * \return the USB product version, or zero if unavailable.
510 *
511 * \since This function is available since SDL 2.0.6.
512 */
513extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
514
515/**
516 * Get the firmware version of an opened controller, if available.
517 *
518 * If the firmware version isn't available this function returns 0.
519 *
520 * \param gamecontroller the game controller object to query.
521 * \return the controller firmware version, or zero if unavailable.
522 *
523 * \since This function is available since SDL 2.24.0.
524 */
525extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller);
526
527/**
528 * Get the serial number of an opened controller, if available.
529 *
530 * Returns the serial number of the controller, or NULL if it is not
531 * available.
532 *
533 * \param gamecontroller the game controller object to query.
534 * \return the serial number, or NULL if unavailable.
535 *
536 * \since This function is available since SDL 2.0.14.
537 */
538extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
539
540/**
541 * Get the Steam Input handle of an opened controller, if available.
542 *
543 * Returns an InputHandle_t for the controller that can be used with Steam
544 * Input API: https://partner.steamgames.com/doc/api/ISteamInput
545 *
546 * \param gamecontroller the game controller object to query.
547 * \returns the gamepad handle, or 0 if unavailable.
548 *
549 * \since This function is available since SDL 2.30.0.
550 */
551extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller);
552
553
554/**
555 * Check if a controller has been opened and is currently connected.
556 *
557 * \param gamecontroller a game controller identifier previously returned by
558 * SDL_GameControllerOpen().
559 * \returns SDL_TRUE if the controller has been opened and is currently
560 * connected, or SDL_FALSE if not.
561 *
562 * \since This function is available since SDL 2.0.0.
563 *
564 * \sa SDL_GameControllerClose
565 * \sa SDL_GameControllerOpen
566 */
567extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
568
569/**
570 * Get the Joystick ID from a Game Controller.
571 *
572 * This function will give you a SDL_Joystick object, which allows you to use
573 * the SDL_Joystick functions with a SDL_GameController object. This would be
574 * useful for getting a joystick's position at any given time, even if it
575 * hasn't moved (moving it would produce an event, which would have the axis'
576 * value).
577 *
578 * The pointer returned is owned by the SDL_GameController. You should not
579 * call SDL_JoystickClose() on it, for example, since doing so will likely
580 * cause SDL to crash.
581 *
582 * \param gamecontroller the game controller object that you want to get a
583 * joystick from.
584 * \returns a SDL_Joystick object; call SDL_GetError() for more information.
585 *
586 * \since This function is available since SDL 2.0.0.
587 */
588extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
589
590/**
591 * Query or change current state of Game Controller events.
592 *
593 * If controller events are disabled, you must call SDL_GameControllerUpdate()
594 * yourself and check the state of the controller when you want controller
595 * information.
596 *
597 * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
598 * and 1 will have any effect. Other numbers will just be returned.
599 *
600 * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`.
601 * \returns the same value passed to the function, with exception to -1
602 * (SDL_QUERY), which will return the current state.
603 *
604 * \since This function is available since SDL 2.0.0.
605 *
606 * \sa SDL_JoystickEventState
607 */
608extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
609
610/**
611 * Manually pump game controller updates if not using the loop.
612 *
613 * This function is called automatically by the event loop if events are
614 * enabled. Under such circumstances, it will not be necessary to call this
615 * function.
616 *
617 * \since This function is available since SDL 2.0.0.
618 */
619extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
620
621
622/**
623 * The list of axes available from a controller
624 *
625 * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to
626 * SDL_JOYSTICK_AXIS_MAX, and are centered within ~8000 of zero, though
627 * advanced UI will allow users to set or autodetect the dead zone, which
628 * varies between controllers.
629 *
630 * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX (fully
631 * pressed) when reported by SDL_GameControllerGetAxis(). Note that this is
632 * not the same range that will be reported by the lower-level
633 * SDL_GetJoystickAxis().
634 */
646
647/**
648 * Convert a string into SDL_GameControllerAxis enum.
649 *
650 * This function is called internally to translate SDL_GameController mapping
651 * strings for the underlying joystick device into the consistent
652 * SDL_GameController mapping. You do not normally need to call this function
653 * unless you are parsing SDL_GameController mappings in your own code.
654 *
655 * Note specially that "righttrigger" and "lefttrigger" map to
656 * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
657 * respectively.
658 *
659 * \param str string representing a SDL_GameController axis.
660 * \returns the SDL_GameControllerAxis enum corresponding to the input string,
661 * or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
662 *
663 * \since This function is available since SDL 2.0.0.
664 *
665 * \sa SDL_GameControllerGetStringForAxis
666 */
667extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str);
668
669/**
670 * Convert from an SDL_GameControllerAxis enum to a string.
671 *
672 * The caller should not SDL_free() the returned string.
673 *
674 * \param axis an enum value for a given SDL_GameControllerAxis.
675 * \returns a string for the given axis, or NULL if an invalid axis is
676 * specified. The string returned is of the format used by
677 * SDL_GameController mapping strings.
678 *
679 * \since This function is available since SDL 2.0.0.
680 *
681 * \sa SDL_GameControllerGetAxisFromString
682 */
683extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
684
685/**
686 * Get the SDL joystick layer binding for a controller axis mapping.
687 *
688 * \param gamecontroller a game controller.
689 * \param axis an axis enum value (one of the SDL_GameControllerAxis values).
690 * \returns a SDL_GameControllerButtonBind describing the bind. On failure
691 * (like the given Controller axis doesn't exist on the device), its
692 * `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
693 *
694 * \since This function is available since SDL 2.0.0.
695 *
696 * \sa SDL_GameControllerGetBindForButton
697 */
698extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
701
702/**
703 * Query whether a game controller has a given axis.
704 *
705 * This merely reports whether the controller's mapping defined this axis, as
706 * that is all the information SDL has about the physical device.
707 *
708 * \param gamecontroller a game controller.
709 * \param axis an axis enum value (an SDL_GameControllerAxis value).
710 * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
711 *
712 * \since This function is available since SDL 2.0.14.
713 */
714extern DECLSPEC SDL_bool SDLCALL
716
717/**
718 * Get the current state of an axis control on a game controller.
719 *
720 * The axis indices start at index 0.
721 *
722 * For thumbsticks, the state is a value ranging from -32768 (up/left) to
723 * 32767 (down/right).
724 *
725 * Triggers range from 0 when released to 32767 when fully pressed, and never
726 * return a negative value. Note that this differs from the value reported by
727 * the lower-level SDL_JoystickGetAxis(), which normally uses the full range.
728 *
729 * \param gamecontroller a game controller.
730 * \param axis an axis index (one of the SDL_GameControllerAxis values).
731 * \returns axis state (including 0) on success or 0 (also) on failure; call
732 * SDL_GetError() for more information.
733 *
734 * \since This function is available since SDL 2.0.0.
735 *
736 * \sa SDL_GameControllerGetButton
737 */
738extern DECLSPEC Sint16 SDLCALL
740
741/**
742 * The list of buttons available from a controller
743 */
770
771/**
772 * Convert a string into an SDL_GameControllerButton enum.
773 *
774 * This function is called internally to translate SDL_GameController mapping
775 * strings for the underlying joystick device into the consistent
776 * SDL_GameController mapping. You do not normally need to call this function
777 * unless you are parsing SDL_GameController mappings in your own code.
778 *
779 * \param str string representing a SDL_GameController axis.
780 * \returns the SDL_GameControllerButton enum corresponding to the input
781 * string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
782 *
783 * \since This function is available since SDL 2.0.0.
784 */
786
787/**
788 * Convert from an SDL_GameControllerButton enum to a string.
789 *
790 * The caller should not SDL_free() the returned string.
791 *
792 * \param button an enum value for a given SDL_GameControllerButton.
793 * \returns a string for the given button, or NULL if an invalid button is
794 * specified. The string returned is of the format used by
795 * SDL_GameController mapping strings.
796 *
797 * \since This function is available since SDL 2.0.0.
798 *
799 * \sa SDL_GameControllerGetButtonFromString
800 */
801extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
802
803/**
804 * Get the SDL joystick layer binding for a controller button mapping.
805 *
806 * \param gamecontroller a game controller.
807 * \param button an button enum value (an SDL_GameControllerButton value).
808 * \returns a SDL_GameControllerButtonBind describing the bind. On failure
809 * (like the given Controller button doesn't exist on the device),
810 * its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
811 *
812 * \since This function is available since SDL 2.0.0.
813 *
814 * \sa SDL_GameControllerGetBindForAxis
815 */
816extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
819
820/**
821 * Query whether a game controller has a given button.
822 *
823 * This merely reports whether the controller's mapping defined this button,
824 * as that is all the information SDL has about the physical device.
825 *
826 * \param gamecontroller a game controller.
827 * \param button a button enum value (an SDL_GameControllerButton value).
828 * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
829 *
830 * \since This function is available since SDL 2.0.14.
831 */
832extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
834
835/**
836 * Get the current state of a button on a game controller.
837 *
838 * \param gamecontroller a game controller.
839 * \param button a button index (one of the SDL_GameControllerButton values).
840 * \returns 1 for pressed state or 0 for not pressed state or error; call
841 * SDL_GetError() for more information.
842 *
843 * \since This function is available since SDL 2.0.0.
844 *
845 * \sa SDL_GameControllerGetAxis
846 */
847extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
849
850/**
851 * Get the number of touchpads on a game controller.
852 *
853 * \since This function is available since SDL 2.0.14.
854 */
855extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
856
857/**
858 * Get the number of supported simultaneous fingers on a touchpad on a game
859 * controller.
860 *
861 * \since This function is available since SDL 2.0.14.
862 */
863extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
864
865/**
866 * Get the current state of a finger on a touchpad on a game controller.
867 *
868 * \since This function is available since SDL 2.0.14.
869 */
870extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
871
872/**
873 * Return whether a game controller has a particular sensor.
874 *
875 * \param gamecontroller The controller to query.
876 * \param type The type of sensor to query.
877 * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
878 *
879 * \since This function is available since SDL 2.0.14.
880 */
881extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
882
883/**
884 * Set whether data reporting for a game controller sensor is enabled.
885 *
886 * \param gamecontroller The controller to update.
887 * \param type The type of sensor to enable/disable.
888 * \param enabled Whether data reporting should be enabled.
889 * \returns 0 or -1 if an error occurred.
890 *
891 * \since This function is available since SDL 2.0.14.
892 */
893extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
894
895/**
896 * Query whether sensor data reporting is enabled for a game controller.
897 *
898 * \param gamecontroller The controller to query.
899 * \param type The type of sensor to query.
900 * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
901 *
902 * \since This function is available since SDL 2.0.14.
903 */
905
906/**
907 * Get the data rate (number of events per second) of a game controller
908 * sensor.
909 *
910 * \param gamecontroller The controller to query.
911 * \param type The type of sensor to query.
912 * \return the data rate, or 0.0f if the data rate is not available.
913 *
914 * \since This function is available since SDL 2.0.16.
915 */
916extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type);
917
918/**
919 * Get the current state of a game controller sensor.
920 *
921 * The number of values and interpretation of the data is sensor dependent.
922 * See SDL_sensor.h for the details for each type of sensor.
923 *
924 * \param gamecontroller The controller to query.
925 * \param type The type of sensor to query.
926 * \param data A pointer filled with the current sensor state.
927 * \param num_values The number of values to write to data.
928 * \return 0 or -1 if an error occurred.
929 *
930 * \since This function is available since SDL 2.0.14.
931 */
932extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
933
934/**
935 * Get the current state of a game controller sensor with the timestamp of the
936 * last update.
937 *
938 * The number of values and interpretation of the data is sensor dependent.
939 * See SDL_sensor.h for the details for each type of sensor.
940 *
941 * \param gamecontroller The controller to query.
942 * \param type The type of sensor to query.
943 * \param timestamp A pointer filled with the timestamp in microseconds of the
944 * current sensor reading if available, or 0 if not.
945 * \param data A pointer filled with the current sensor state.
946 * \param num_values The number of values to write to data.
947 * \return 0 or -1 if an error occurred.
948 *
949 * \since This function is available since SDL 2.26.0.
950 */
951extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values);
952
953/**
954 * Start a rumble effect on a game controller.
955 *
956 * Each call to this function cancels any previous rumble effect, and calling
957 * it with 0 intensity stops any rumbling.
958 *
959 * \param gamecontroller The controller to vibrate.
960 * \param low_frequency_rumble The intensity of the low frequency (left)
961 * rumble motor, from 0 to 0xFFFF.
962 * \param high_frequency_rumble The intensity of the high frequency (right)
963 * rumble motor, from 0 to 0xFFFF.
964 * \param duration_ms The duration of the rumble effect, in milliseconds.
965 * \returns 0, or -1 if rumble isn't supported on this controller.
966 *
967 * \since This function is available since SDL 2.0.9.
968 *
969 * \sa SDL_GameControllerHasRumble
970 */
971extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
972
973/**
974 * Start a rumble effect in the game controller's triggers.
975 *
976 * Each call to this function cancels any previous trigger rumble effect, and
977 * calling it with 0 intensity stops any rumbling.
978 *
979 * Note that this is rumbling of the _triggers_ and not the game controller as
980 * a whole. This is currently only supported on Xbox One controllers. If you
981 * want the (more common) whole-controller rumble, use
982 * SDL_GameControllerRumble() instead.
983 *
984 * \param gamecontroller The controller to vibrate.
985 * \param left_rumble The intensity of the left trigger rumble motor, from 0
986 * to 0xFFFF.
987 * \param right_rumble The intensity of the right trigger rumble motor, from 0
988 * to 0xFFFF.
989 * \param duration_ms The duration of the rumble effect, in milliseconds.
990 * \returns 0, or -1 if trigger rumble isn't supported on this controller.
991 *
992 * \since This function is available since SDL 2.0.14.
993 *
994 * \sa SDL_GameControllerHasRumbleTriggers
995 */
996extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
997
998/**
999 * Query whether a game controller has an LED.
1000 *
1001 * \param gamecontroller The controller to query.
1002 * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
1003 * modifiable LED.
1004 *
1005 * \since This function is available since SDL 2.0.14.
1006 */
1007extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
1008
1009/**
1010 * Query whether a game controller has rumble support.
1011 *
1012 * \param gamecontroller The controller to query.
1013 * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
1014 * support.
1015 *
1016 * \since This function is available since SDL 2.0.18.
1017 *
1018 * \sa SDL_GameControllerRumble
1019 */
1020extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller);
1021
1022/**
1023 * Query whether a game controller has rumble support on triggers.
1024 *
1025 * \param gamecontroller The controller to query.
1026 * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
1027 * rumble support.
1028 *
1029 * \since This function is available since SDL 2.0.18.
1030 *
1031 * \sa SDL_GameControllerRumbleTriggers
1032 */
1033extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller);
1034
1035/**
1036 * Update a game controller's LED color.
1037 *
1038 * \param gamecontroller The controller to update.
1039 * \param red The intensity of the red LED.
1040 * \param green The intensity of the green LED.
1041 * \param blue The intensity of the blue LED.
1042 * \returns 0, or -1 if this controller does not have a modifiable LED.
1043 *
1044 * \since This function is available since SDL 2.0.14.
1045 */
1046extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
1047
1048/**
1049 * Send a controller specific effect packet
1050 *
1051 * \param gamecontroller The controller to affect.
1052 * \param data The data to send to the controller.
1053 * \param size The size of the data to send to the controller.
1054 * \returns 0, or -1 if this controller or driver doesn't support effect
1055 * packets.
1056 *
1057 * \since This function is available since SDL 2.0.16.
1058 */
1059extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size);
1060
1061/**
1062 * Close a game controller previously opened with SDL_GameControllerOpen().
1063 *
1064 * \param gamecontroller a game controller identifier previously returned by
1065 * SDL_GameControllerOpen().
1066 *
1067 * \since This function is available since SDL 2.0.0.
1068 *
1069 * \sa SDL_GameControllerOpen
1070 */
1071extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
1072
1073/**
1074 * Return the sfSymbolsName for a given button on a game controller on Apple
1075 * platforms.
1076 *
1077 * \param gamecontroller the controller to query.
1078 * \param button a button on the game controller.
1079 * \returns the sfSymbolsName or NULL if the name can't be found.
1080 *
1081 * \since This function is available since SDL 2.0.18.
1082 *
1083 * \sa SDL_GameControllerGetAppleSFSymbolsNameForAxis
1084 */
1085extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button);
1086
1087/**
1088 * Return the sfSymbolsName for a given axis on a game controller on Apple
1089 * platforms.
1090 *
1091 * \param gamecontroller the controller to query.
1092 * \param axis an axis on the game controller.
1093 * \returns the sfSymbolsName or NULL if the name can't be found.
1094 *
1095 * \since This function is available since SDL 2.0.18.
1096 *
1097 * \sa SDL_GameControllerGetAppleSFSymbolsNameForButton
1098 */
1099extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
1100
1101
1102/* Ends C function definitions when using C++ */
1103#ifdef __cplusplus
1104}
1105#endif
1106#include "close_code.h"
1107
1108#endif /* SDL_gamecontroller_h_ */
1109
1110/* vi: set ts=4 sw=4 expandtab: */
char * SDL_GameControllerMappingForDeviceIndex(int joystick_index)
const char * SDL_GameControllerNameForIndex(int joystick_index)
const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
const char * SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
SDL_bool SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type)
void SDL_GameControllerUpdate(void)
int SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values)
int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw)
const char * SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
SDL_GameController * SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)
SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller)
SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index)
int SDL_GameControllerNumMappings(void)
void SDL_GameControllerClose(SDL_GameController *gamecontroller)
int SDL_GameControllerEventState(int state)
int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
const char * SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
SDL_bool SDL_GameControllerHasRumble(SDL_GameController *gamecontroller)
SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
SDL_bool SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type)
int SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure)
const char * SDL_GameControllerName(SDL_GameController *gamecontroller)
SDL_bool SDL_IsGameController(int joystick_index)
char * SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
const char * SDL_GameControllerGetStringForButton(SDL_GameControllerButton button)
int SDL_GameControllerAddMapping(const char *mappingString)
SDL_GameController * SDL_GameControllerFromPlayerIndex(int player_index)
int SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad)
SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled)
float SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type)
int SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)
Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
SDL_GameControllerAxis
@ SDL_CONTROLLER_AXIS_LEFTX
@ SDL_CONTROLLER_AXIS_TRIGGERRIGHT
@ SDL_CONTROLLER_AXIS_INVALID
@ SDL_CONTROLLER_AXIS_RIGHTY
@ SDL_CONTROLLER_AXIS_RIGHTX
@ SDL_CONTROLLER_AXIS_MAX
@ SDL_CONTROLLER_AXIS_TRIGGERLEFT
@ SDL_CONTROLLER_AXIS_LEFTY
Uint64 SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller)
SDL_GameControllerButton
@ SDL_CONTROLLER_BUTTON_B
@ SDL_CONTROLLER_BUTTON_BACK
@ SDL_CONTROLLER_BUTTON_LEFTSTICK
@ SDL_CONTROLLER_BUTTON_START
@ SDL_CONTROLLER_BUTTON_PADDLE2
@ SDL_CONTROLLER_BUTTON_PADDLE1
@ SDL_CONTROLLER_BUTTON_DPAD_LEFT
@ SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
@ SDL_CONTROLLER_BUTTON_INVALID
@ SDL_CONTROLLER_BUTTON_DPAD_DOWN
@ SDL_CONTROLLER_BUTTON_TOUCHPAD
@ SDL_CONTROLLER_BUTTON_DPAD_UP
@ SDL_CONTROLLER_BUTTON_MAX
@ SDL_CONTROLLER_BUTTON_LEFTSHOULDER
@ SDL_CONTROLLER_BUTTON_GUIDE
@ SDL_CONTROLLER_BUTTON_DPAD_RIGHT
@ SDL_CONTROLLER_BUTTON_MISC1
@ SDL_CONTROLLER_BUTTON_X
@ SDL_CONTROLLER_BUTTON_RIGHTSTICK
@ SDL_CONTROLLER_BUTTON_PADDLE3
@ SDL_CONTROLLER_BUTTON_Y
@ SDL_CONTROLLER_BUTTON_A
@ SDL_CONTROLLER_BUTTON_PADDLE4
struct _SDL_GameController SDL_GameController
Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *str)
SDL_Joystick * SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)
int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue)
char * SDL_GameControllerMapping(SDL_GameController *gamecontroller)
Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
int SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller)
SDL_GameController * SDL_GameControllerOpen(int joystick_index)
Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
const char * SDL_GameControllerPath(SDL_GameController *gamecontroller)
SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller)
void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)
SDL_bool SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
const char * SDL_GameControllerPathForIndex(int joystick_index)
SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
char * SDL_GameControllerMappingForIndex(int mapping_index)
int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size)
SDL_GameControllerType
@ SDL_CONTROLLER_TYPE_VIRTUAL
@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT
@ SDL_CONTROLLER_TYPE_XBOX360
@ SDL_CONTROLLER_TYPE_PS4
@ SDL_CONTROLLER_TYPE_NVIDIA_SHIELD
@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO
@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
@ SDL_CONTROLLER_TYPE_GOOGLE_STADIA
@ SDL_CONTROLLER_TYPE_AMAZON_LUNA
@ SDL_CONTROLLER_TYPE_PS3
@ SDL_CONTROLLER_TYPE_PS5
@ SDL_CONTROLLER_TYPE_XBOXONE
@ SDL_CONTROLLER_TYPE_UNKNOWN
@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT
@ SDL_CONTROLLER_TYPE_MAX
SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *str)
SDL_GameControllerBindType
@ SDL_CONTROLLER_BINDTYPE_AXIS
@ SDL_CONTROLLER_BINDTYPE_HAT
@ SDL_CONTROLLER_BINDTYPE_NONE
@ SDL_CONTROLLER_BINDTYPE_BUTTON
SDL_bool SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller)
struct _SDL_Joystick SDL_Joystick
Sint32 SDL_JoystickID
SDL_SensorType
Definition SDL_sensor.h:115
uint8_t Uint8
Definition SDL_stdinc.h:203
uint16_t Uint16
Definition SDL_stdinc.h:217
SDL_bool
Definition SDL_stdinc.h:187
int16_t Sint16
Definition SDL_stdinc.h:210
uint64_t Uint64
Definition SDL_stdinc.h:245
uint32_t Uint32
Definition SDL_stdinc.h:231
SDL_GameControllerBindType bindType
union SDL_GameControllerButtonBind::@0 value