SDL_gamecontroller.h 40 KB

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