SDL_gamecontroller.h 40 KB

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