1
0

SDL_gamepad.h 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 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_gamepad.h
  20. *
  21. * \brief Include file for SDL gamepad event handling
  22. */
  23. #ifndef SDL_gamepad_h_
  24. #define SDL_gamepad_h_
  25. #include <SDL3/SDL_stdinc.h>
  26. #include <SDL3/SDL_error.h>
  27. #include <SDL3/SDL_rwops.h>
  28. #include <SDL3/SDL_sensor.h>
  29. #include <SDL3/SDL_joystick.h>
  30. #include <SDL3/SDL_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_gamepad.h
  37. *
  38. * In order to use these functions, SDL_Init() must have been called
  39. * with the ::SDL_INIT_GAMEPAD flag. This causes SDL to scan the system
  40. * for gamepads, and load appropriate drivers.
  41. *
  42. * If you would like to receive gamepad 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 structure used to identify an SDL gamepad
  48. */
  49. struct SDL_Gamepad;
  50. typedef struct SDL_Gamepad SDL_Gamepad;
  51. typedef enum
  52. {
  53. SDL_GAMEPAD_TYPE_UNKNOWN = 0,
  54. SDL_GAMEPAD_TYPE_VIRTUAL,
  55. SDL_GAMEPAD_TYPE_XBOX360,
  56. SDL_GAMEPAD_TYPE_XBOXONE,
  57. SDL_GAMEPAD_TYPE_PS3,
  58. SDL_GAMEPAD_TYPE_PS4,
  59. SDL_GAMEPAD_TYPE_PS5,
  60. SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO,
  61. SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
  62. SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
  63. SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
  64. SDL_GAMEPAD_TYPE_AMAZON_LUNA,
  65. SDL_GAMEPAD_TYPE_GOOGLE_STADIA,
  66. SDL_GAMEPAD_TYPE_NVIDIA_SHIELD
  67. } SDL_GamepadType;
  68. /**
  69. * The list of buttons available on a gamepad
  70. */
  71. typedef enum
  72. {
  73. SDL_GAMEPAD_BUTTON_INVALID = -1,
  74. SDL_GAMEPAD_BUTTON_A,
  75. SDL_GAMEPAD_BUTTON_B,
  76. SDL_GAMEPAD_BUTTON_X,
  77. SDL_GAMEPAD_BUTTON_Y,
  78. SDL_GAMEPAD_BUTTON_BACK,
  79. SDL_GAMEPAD_BUTTON_GUIDE,
  80. SDL_GAMEPAD_BUTTON_START,
  81. SDL_GAMEPAD_BUTTON_LEFT_STICK,
  82. SDL_GAMEPAD_BUTTON_RIGHT_STICK,
  83. SDL_GAMEPAD_BUTTON_LEFT_SHOULDER,
  84. SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER,
  85. SDL_GAMEPAD_BUTTON_DPAD_UP,
  86. SDL_GAMEPAD_BUTTON_DPAD_DOWN,
  87. SDL_GAMEPAD_BUTTON_DPAD_LEFT,
  88. SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
  89. SDL_GAMEPAD_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
  90. SDL_GAMEPAD_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
  91. SDL_GAMEPAD_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
  92. SDL_GAMEPAD_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
  93. SDL_GAMEPAD_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
  94. SDL_GAMEPAD_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
  95. SDL_GAMEPAD_BUTTON_MAX
  96. } SDL_GamepadButton;
  97. /**
  98. * The list of axes available on a gamepad
  99. *
  100. * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
  101. * and are centered within ~8000 of zero, though advanced UI will allow users to set
  102. * or autodetect the dead zone, which varies between gamepads.
  103. *
  104. * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
  105. */
  106. typedef enum
  107. {
  108. SDL_GAMEPAD_AXIS_INVALID = -1,
  109. SDL_GAMEPAD_AXIS_LEFTX,
  110. SDL_GAMEPAD_AXIS_LEFTY,
  111. SDL_GAMEPAD_AXIS_RIGHTX,
  112. SDL_GAMEPAD_AXIS_RIGHTY,
  113. SDL_GAMEPAD_AXIS_LEFT_TRIGGER,
  114. SDL_GAMEPAD_AXIS_RIGHT_TRIGGER,
  115. SDL_GAMEPAD_AXIS_MAX
  116. } SDL_GamepadAxis;
  117. typedef enum
  118. {
  119. SDL_GAMEPAD_BINDTYPE_NONE = 0,
  120. SDL_GAMEPAD_BINDTYPE_BUTTON,
  121. SDL_GAMEPAD_BINDTYPE_AXIS,
  122. SDL_GAMEPAD_BINDTYPE_HAT
  123. } SDL_GamepadBindingType;
  124. /**
  125. * Get the SDL joystick layer binding for this gamepad button/axis mapping
  126. */
  127. typedef struct SDL_GamepadBinding
  128. {
  129. SDL_GamepadBindingType bindType;
  130. union
  131. {
  132. int button;
  133. int axis;
  134. struct {
  135. int hat;
  136. int hat_mask;
  137. } hat;
  138. } value;
  139. } SDL_GamepadBinding;
  140. /**
  141. * Add support for gamepads that SDL is unaware of or change the binding of an
  142. * existing gamepad.
  143. *
  144. * The mapping string has the format "GUID,name,mapping", where GUID is the
  145. * string value from SDL_GetJoystickGUIDString(), name is the human readable
  146. * string for the device and mappings are gamepad mappings to joystick ones.
  147. * Under Windows there is a reserved GUID of "xinput" that covers all XInput
  148. * devices. The mapping format for joystick is:
  149. *
  150. * - `bX`: a joystick button, index X
  151. * - `hX.Y`: hat X with value Y
  152. * - `aX`: axis X of the joystick
  153. *
  154. * Buttons can be used as a gamepad axes and vice versa.
  155. *
  156. * This string shows an example of a valid mapping for a gamepad:
  157. *
  158. * ```c
  159. * "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"
  160. * ```
  161. *
  162. * \param mappingString the mapping string
  163. * \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
  164. * -1 on error; call SDL_GetError() for more information.
  165. *
  166. * \since This function is available since SDL 3.0.0.
  167. *
  168. * \sa SDL_GetGamepadMapping
  169. * \sa SDL_GetGamepadMappingForGUID
  170. */
  171. extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mappingString);
  172. /**
  173. * Load a set of gamepad mappings from a seekable SDL data stream.
  174. *
  175. * You can call this function several times, if needed, to load different
  176. * database files.
  177. *
  178. * If a new mapping is loaded for an already known gamepad GUID, the later
  179. * version will overwrite the one currently loaded.
  180. *
  181. * Mappings not belonging to the current platform or with no platform field
  182. * specified will be ignored (i.e. mappings for Linux will be ignored in
  183. * Windows, etc).
  184. *
  185. * This function will load the text database entirely in memory before
  186. * processing it, so take this into consideration if you are in a memory
  187. * constrained environment.
  188. *
  189. * \param rw the data stream for the mappings to be added
  190. * \param freerw non-zero to close the stream after being read
  191. * \returns the number of mappings added or -1 on error; call SDL_GetError()
  192. * for more information.
  193. *
  194. * \since This function is available since SDL 3.0.0.
  195. *
  196. * \sa SDL_AddGamepadMapping
  197. * \sa SDL_AddGamepadMappingsFromFile
  198. * \sa SDL_GetGamepadMappingForGUID
  199. */
  200. extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *rw, int freerw);
  201. /**
  202. * Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
  203. *
  204. * Convenience macro.
  205. */
  206. #define SDL_AddGamepadMappingsFromFile(file) SDL_AddGamepadMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
  207. /**
  208. * Get the number of mappings installed.
  209. *
  210. * \returns the number of mappings.
  211. *
  212. * \since This function is available since SDL 3.0.0.
  213. */
  214. extern DECLSPEC int SDLCALL SDL_GetNumGamepadMappings(void);
  215. /**
  216. * Get the mapping at a particular index.
  217. *
  218. * \param mapping_index mapping index
  219. * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
  220. * the index is out of range.
  221. *
  222. * \since This function is available since SDL 3.0.0.
  223. */
  224. extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForIndex(int mapping_index);
  225. /**
  226. * Get the gamepad mapping string for a given GUID.
  227. *
  228. * The returned string must be freed with SDL_free().
  229. *
  230. * \param guid a structure containing the GUID for which a mapping is desired
  231. * \returns a mapping string or NULL on error; call SDL_GetError() for more
  232. * information.
  233. *
  234. * \since This function is available since SDL 3.0.0.
  235. *
  236. * \sa SDL_GetJoystickInstanceGUID
  237. * \sa SDL_GetJoystickGUID
  238. */
  239. extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid);
  240. /**
  241. * Get the current mapping of a gamepad.
  242. *
  243. * The returned string must be freed with SDL_free().
  244. *
  245. * Details about mappings are discussed with SDL_AddGamepadMapping().
  246. *
  247. * \param gamepad the gamepad you want to get the current mapping for
  248. * \returns a string that has the gamepad's mapping or NULL if no mapping is
  249. * available; call SDL_GetError() for more information.
  250. *
  251. * \since This function is available since SDL 3.0.0.
  252. *
  253. * \sa SDL_AddGamepadMapping
  254. * \sa SDL_GetGamepadMappingForGUID
  255. */
  256. extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
  257. /**
  258. * Get a list of currently connected gamepads.
  259. *
  260. * \param count a pointer filled in with the number of gamepads returned
  261. * \returns a 0 terminated array of joystick instance IDs which should be
  262. * freed with SDL_free(), or NULL on error; call SDL_GetError() for
  263. * more details.
  264. *
  265. * \since This function is available since SDL 3.0.0.
  266. *
  267. * \sa SDL_OpenGamepad
  268. */
  269. extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
  270. /**
  271. * Check if the given joystick is supported by the gamepad interface.
  272. *
  273. * \param instance_id the joystick instance ID
  274. * \returns SDL_TRUE if the given joystick is supported by the gamepad
  275. * interface, SDL_FALSE if it isn't or it's an invalid index.
  276. *
  277. * \since This function is available since SDL 3.0.0.
  278. *
  279. * \sa SDL_GetGamepadNameForIndex
  280. * \sa SDL_OpenGamepad
  281. */
  282. extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
  283. /**
  284. * Get the implementation dependent name of a gamepad.
  285. *
  286. * This can be called before any gamepads are opened.
  287. *
  288. * \param instance_id the joystick instance ID
  289. * \returns the name of the selected gamepad. If no name can be found, this
  290. * function returns NULL; call SDL_GetError() for more information.
  291. *
  292. * \since This function is available since SDL 3.0.0.
  293. *
  294. * \sa SDL_GetGamepadName
  295. * \sa SDL_OpenGamepad
  296. */
  297. extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
  298. /**
  299. * Get the implementation dependent path of a gamepad.
  300. *
  301. * This can be called before any gamepads are opened.
  302. *
  303. * \param instance_id the joystick instance ID
  304. * \returns the path of the selected gamepad. If no path can be found, this
  305. * function returns NULL; call SDL_GetError() for more information.
  306. *
  307. * \since This function is available since SDL 3.0.0.
  308. *
  309. * \sa SDL_GetGamepadPath
  310. * \sa SDL_OpenGamepad
  311. */
  312. extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
  313. /**
  314. * Get the player index of a gamepad.
  315. *
  316. * This can be called before any gamepads are opened.
  317. *
  318. * \param instance_id the joystick instance ID
  319. * \returns the player index of a gamepad, or -1 if it's not available
  320. *
  321. * \since This function is available since SDL 3.0.0.
  322. *
  323. * \sa SDL_GetGamepadPlayerIndex
  324. * \sa SDL_OpenGamepad
  325. */
  326. extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
  327. /**
  328. * Get the implementation-dependent GUID of a gamepad.
  329. *
  330. * This can be called before any gamepads are opened.
  331. *
  332. * \param instance_id the joystick instance ID
  333. * \returns the GUID of the selected gamepad. If called on an invalid index,
  334. * this function returns a zero GUID
  335. *
  336. * \since This function is available since SDL 3.0.0.
  337. *
  338. * \sa SDL_GetGamepadGUID
  339. * \sa SDL_GetGamepadGUIDString
  340. */
  341. extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
  342. /**
  343. * Get the USB vendor ID of a gamepad, if available.
  344. *
  345. * This can be called before any gamepads are opened. If the vendor ID isn't
  346. * available this function returns 0.
  347. *
  348. * \param instance_id the joystick instance ID
  349. * \returns the USB vendor ID of the selected gamepad. If called on an invalid
  350. * index, this function returns zero
  351. *
  352. * \since This function is available since SDL 3.0.0.
  353. */
  354. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
  355. /**
  356. * Get the USB product ID of a gamepad, if available.
  357. *
  358. * This can be called before any gamepads are opened. If the product ID isn't
  359. * available this function returns 0.
  360. *
  361. * \param instance_id the joystick instance ID
  362. * \returns the USB product ID of the selected gamepad. If called on an
  363. * invalid index, this function returns zero
  364. *
  365. * \since This function is available since SDL 3.0.0.
  366. */
  367. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
  368. /**
  369. * Get the product version of a gamepad, if available.
  370. *
  371. * This can be called before any gamepads are opened. If the product version
  372. * isn't available this function returns 0.
  373. *
  374. * \param instance_id the joystick instance ID
  375. * \returns the product version of the selected gamepad. If called on an
  376. * invalid index, this function returns zero
  377. *
  378. * \since This function is available since SDL 3.0.0.
  379. */
  380. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
  381. /**
  382. * Get the type of a gamepad.
  383. *
  384. * This can be called before any gamepads are opened.
  385. *
  386. * \param instance_id the joystick instance ID
  387. * \returns the gamepad type.
  388. *
  389. * \since This function is available since SDL 3.0.0.
  390. */
  391. extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
  392. /**
  393. * Get the mapping of a gamepad.
  394. *
  395. * This can be called before any gamepads are opened.
  396. *
  397. * \param instance_id the joystick instance ID
  398. * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
  399. * no mapping is available.
  400. *
  401. * \since This function is available since SDL 3.0.0.
  402. */
  403. extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
  404. /**
  405. * Open a gamepad for use.
  406. *
  407. * \param instance_id the joystick instance ID
  408. * \returns a gamepad identifier or NULL if an error occurred; call
  409. * SDL_GetError() for more information.
  410. *
  411. * \since This function is available since SDL 3.0.0.
  412. *
  413. * \sa SDL_CloseGamepad
  414. * \sa SDL_GetGamepadNameForIndex
  415. * \sa SDL_IsGamepad
  416. */
  417. extern DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id);
  418. /**
  419. * Get the SDL_Gamepad associated with a joystick instance ID, if it has been
  420. * opened.
  421. *
  422. * \param instance_id the joystick instance ID of the gamepad
  423. * \returns an SDL_Gamepad on success or NULL on failure or if it hasn't been
  424. * opened yet; call SDL_GetError() for more information.
  425. *
  426. * \since This function is available since SDL 3.0.0.
  427. */
  428. extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromInstanceID(SDL_JoystickID instance_id);
  429. /**
  430. * Get the SDL_Gamepad associated with a player index.
  431. *
  432. * \param player_index the player index, which different from the instance ID
  433. * \returns the SDL_Gamepad associated with a player index.
  434. *
  435. * \since This function is available since SDL 3.0.0.
  436. *
  437. * \sa SDL_GetGamepadPlayerIndex
  438. * \sa SDL_SetGamepadPlayerIndex
  439. */
  440. extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index);
  441. /**
  442. * Get the implementation-dependent name for an opened gamepad.
  443. *
  444. * This is the same name as returned by SDL_GetGamepadNameForIndex(), but it
  445. * takes a gamepad identifier instead of the (unstable) device index.
  446. *
  447. * \param gamepad a gamepad identifier previously returned by
  448. * SDL_OpenGamepad()
  449. * \returns the implementation dependent name for the gamepad, or NULL if
  450. * there is no name or the identifier passed is invalid.
  451. *
  452. * \since This function is available since SDL 3.0.0.
  453. *
  454. * \sa SDL_GetGamepadNameForIndex
  455. * \sa SDL_OpenGamepad
  456. */
  457. extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
  458. /**
  459. * Get the implementation-dependent path for an opened gamepad.
  460. *
  461. * This is the same path as returned by SDL_GetGamepadNameForIndex(), but it
  462. * takes a gamepad identifier instead of the (unstable) device index.
  463. *
  464. * \param gamepad a gamepad identifier previously returned by
  465. * SDL_OpenGamepad()
  466. * \returns the implementation dependent path for the gamepad, or NULL if
  467. * there is no path or the identifier passed is invalid.
  468. *
  469. * \since This function is available since SDL 3.0.0.
  470. *
  471. * \sa SDL_GetGamepadInstancePath
  472. */
  473. extern DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
  474. /**
  475. * Get the type of this currently opened gamepad
  476. *
  477. * This is the same name as returned by SDL_GetGamepadInstanceType(), but it
  478. * takes a gamepad identifier instead of the (unstable) device index.
  479. *
  480. * \param gamepad the gamepad object to query.
  481. * \returns the gamepad type.
  482. *
  483. * \since This function is available since SDL 3.0.0.
  484. */
  485. extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad);
  486. /**
  487. * Get the player index of an opened gamepad.
  488. *
  489. * For XInput gamepads this returns the XInput user index.
  490. *
  491. * \param gamepad the gamepad object to query.
  492. * \returns the player index for gamepad, or -1 if it's not available.
  493. *
  494. * \since This function is available since SDL 3.0.0.
  495. */
  496. extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
  497. /**
  498. * Set the player index of an opened gamepad.
  499. *
  500. * \param gamepad the gamepad object to adjust.
  501. * \param player_index Player index to assign to this gamepad, or -1 to clear
  502. * the player index and turn off player LEDs.
  503. * \returns 0 on success or a negative error code on failure; call
  504. * SDL_GetError() for more information.
  505. *
  506. * \since This function is available since SDL 3.0.0.
  507. */
  508. extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
  509. /**
  510. * Get the USB vendor ID of an opened gamepad, if available.
  511. *
  512. * If the vendor ID isn't available this function returns 0.
  513. *
  514. * \param gamepad the gamepad object to query.
  515. * \returns the USB vendor ID, or zero if unavailable.
  516. *
  517. * \since This function is available since SDL 3.0.0.
  518. */
  519. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
  520. /**
  521. * Get the USB product ID of an opened gamepad, if available.
  522. *
  523. * If the product ID isn't available this function returns 0.
  524. *
  525. * \param gamepad the gamepad object to query.
  526. * \returns the USB product ID, or zero if unavailable.
  527. *
  528. * \since This function is available since SDL 3.0.0.
  529. */
  530. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
  531. /**
  532. * Get the product version of an opened gamepad, if available.
  533. *
  534. * If the product version isn't available this function returns 0.
  535. *
  536. * \param gamepad the gamepad object to query.
  537. * \returns the USB product version, or zero if unavailable.
  538. *
  539. * \since This function is available since SDL 3.0.0.
  540. */
  541. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad);
  542. /**
  543. * Get the firmware version of an opened gamepad, if available.
  544. *
  545. * If the firmware version isn't available this function returns 0.
  546. *
  547. * \param gamepad the gamepad object to query.
  548. * \returns the gamepad firmware version, or zero if unavailable.
  549. *
  550. * \since This function is available since SDL 3.0.0.
  551. */
  552. extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *gamepad);
  553. /**
  554. * Get the serial number of an opened gamepad, if available.
  555. *
  556. * Returns the serial number of the gamepad, or NULL if it is not available.
  557. *
  558. * \param gamepad the gamepad object to query.
  559. * \returns the serial number, or NULL if unavailable.
  560. *
  561. * \since This function is available since SDL 3.0.0.
  562. */
  563. extern DECLSPEC const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
  564. /**
  565. * Check if a gamepad has been opened and is currently connected.
  566. *
  567. * \param gamepad a gamepad identifier previously returned by
  568. * SDL_OpenGamepad()
  569. * \returns SDL_TRUE if the gamepad has been opened and is currently
  570. * connected, or SDL_FALSE if not.
  571. *
  572. * \since This function is available since SDL 3.0.0.
  573. *
  574. * \sa SDL_CloseGamepad
  575. * \sa SDL_OpenGamepad
  576. */
  577. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
  578. /**
  579. * Get the underlying joystick from a gamepad
  580. *
  581. * This function will give you a SDL_Joystick object, which allows you to use
  582. * the SDL_Joystick functions with a SDL_Gamepad object. This would be useful
  583. * for getting a joystick's position at any given time, even if it hasn't
  584. * moved (moving it would produce an event, which would have the axis' value).
  585. *
  586. * The pointer returned is owned by the SDL_Gamepad. You should not call
  587. * SDL_CloseJoystick() on it, for example, since doing so will likely cause
  588. * SDL to crash.
  589. *
  590. * \param gamepad the gamepad object that you want to get a joystick from
  591. * \returns an SDL_Joystick object; call SDL_GetError() for more information.
  592. *
  593. * \since This function is available since SDL 3.0.0.
  594. */
  595. extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepad);
  596. /**
  597. * Set the state of gamepad event processing.
  598. *
  599. * If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself
  600. * and check the state of the gamepad when you want gamepad information.
  601. *
  602. * \param enabled whether to process gamepad events or not
  603. *
  604. * \since This function is available since SDL 3.0.0.
  605. *
  606. * \sa SDL_GamepadEventsEnabled
  607. */
  608. extern DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
  609. /**
  610. * Query the state of gamepad event processing.
  611. *
  612. * If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself
  613. * and check the state of the gamepad when you want gamepad information.
  614. *
  615. * \returns SDL_TRUE if gamepad events are being processed, SDL_FALSE
  616. * otherwise.
  617. *
  618. * \since This function is available since SDL 3.0.0.
  619. *
  620. * \sa SDL_SetGamepadEventsEnabled
  621. */
  622. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
  623. /**
  624. * Manually pump gamepad updates if not using the loop.
  625. *
  626. * This function is called automatically by the event loop if events are
  627. * enabled. Under such circumstances, it will not be necessary to call this
  628. * function.
  629. *
  630. * \since This function is available since SDL 3.0.0.
  631. */
  632. extern DECLSPEC void SDLCALL SDL_UpdateGamepads(void);
  633. /**
  634. * Convert a string into SDL_GamepadAxis enum.
  635. *
  636. * This function is called internally to translate SDL_Gamepad mapping strings
  637. * for the underlying joystick device into the consistent SDL_Gamepad mapping.
  638. * You do not normally need to call this function unless you are parsing
  639. * SDL_Gamepad mappings in your own code.
  640. *
  641. * Note specially that "righttrigger" and "lefttrigger" map to
  642. * `SDL_GAMEPAD_AXIS_RIGHT_TRIGGER` and `SDL_GAMEPAD_AXIS_LEFT_TRIGGER`,
  643. * respectively.
  644. *
  645. * \param str string representing a SDL_Gamepad axis
  646. * \returns the SDL_GamepadAxis enum corresponding to the input string, or
  647. * `SDL_GAMEPAD_AXIS_INVALID` if no match was found.
  648. *
  649. * \since This function is available since SDL 3.0.0.
  650. *
  651. * \sa SDL_GetGamepadStringForAxis
  652. */
  653. extern DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char *str);
  654. /**
  655. * Convert from an SDL_GamepadAxis enum to a string.
  656. *
  657. * The caller should not SDL_free() the returned string.
  658. *
  659. * \param axis an enum value for a given SDL_GamepadAxis
  660. * \returns a string for the given axis, or NULL if an invalid axis is
  661. * specified. The string returned is of the format used by
  662. * SDL_Gamepad mapping strings.
  663. *
  664. * \since This function is available since SDL 3.0.0.
  665. *
  666. * \sa SDL_GetGamepadAxisFromString
  667. */
  668. extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
  669. /**
  670. * Get the SDL joystick layer binding for a gamepad axis mapping.
  671. *
  672. * \param gamepad a gamepad
  673. * \param axis an axis enum value (one of the SDL_GamepadAxis values)
  674. * \returns a SDL_GamepadBinding describing the bind. On failure (like the
  675. * given Controller axis doesn't exist on the device), its
  676. * `.bindType` will be `SDL_GAMEPAD_BINDTYPE_NONE`.
  677. *
  678. * \since This function is available since SDL 3.0.0.
  679. *
  680. * \sa SDL_GetGamepadBindForButton
  681. */
  682. extern DECLSPEC SDL_GamepadBinding SDLCALL SDL_GetGamepadBindForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
  683. /**
  684. * Query whether a gamepad has a given axis.
  685. *
  686. * This merely reports whether the gamepad's mapping defined this axis, as
  687. * that is all the information SDL has about the physical device.
  688. *
  689. * \param gamepad a gamepad
  690. * \param axis an axis enum value (an SDL_GamepadAxis value)
  691. * \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise.
  692. *
  693. * \since This function is available since SDL 3.0.0.
  694. */
  695. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
  696. /**
  697. * Get the current state of an axis control on a gamepad.
  698. *
  699. * The axis indices start at index 0.
  700. *
  701. * The state is a value ranging from -32768 to 32767. Triggers, however, range
  702. * from 0 to 32767 (they never return a negative value).
  703. *
  704. * \param gamepad a gamepad
  705. * \param axis an axis index (one of the SDL_GamepadAxis values)
  706. * \returns axis state (including 0) on success or 0 (also) on failure; call
  707. * SDL_GetError() for more information.
  708. *
  709. * \since This function is available since SDL 3.0.0.
  710. *
  711. * \sa SDL_GetGamepadButton
  712. */
  713. extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
  714. /**
  715. * Convert a string into an SDL_GamepadButton enum.
  716. *
  717. * This function is called internally to translate SDL_Gamepad mapping strings
  718. * for the underlying joystick device into the consistent SDL_Gamepad mapping.
  719. * You do not normally need to call this function unless you are parsing
  720. * SDL_Gamepad mappings in your own code.
  721. *
  722. * \param str string representing a SDL_Gamepad axis
  723. * \returns the SDL_GamepadButton enum corresponding to the input string, or
  724. * `SDL_GAMEPAD_AXIS_INVALID` if no match was found.
  725. *
  726. * \since This function is available since SDL 3.0.0.
  727. */
  728. extern DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const char *str);
  729. /**
  730. * Convert from an SDL_GamepadButton enum to a string.
  731. *
  732. * The caller should not SDL_free() the returned string.
  733. *
  734. * \param button an enum value for a given SDL_GamepadButton
  735. * \returns a string for the given button, or NULL if an invalid button is
  736. * specified. The string returned is of the format used by
  737. * SDL_Gamepad mapping strings.
  738. *
  739. * \since This function is available since SDL 3.0.0.
  740. *
  741. * \sa SDL_GetGamepadButtonFromString
  742. */
  743. extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button);
  744. /**
  745. * Get the SDL joystick layer binding for a gamepad button mapping.
  746. *
  747. * \param gamepad a gamepad
  748. * \param button an button enum value (an SDL_GamepadButton value)
  749. * \returns a SDL_GamepadBinding describing the bind. On failure (like the
  750. * given Controller button doesn't exist on the device), its
  751. * `.bindType` will be `SDL_GAMEPAD_BINDTYPE_NONE`.
  752. *
  753. * \since This function is available since SDL 3.0.0.
  754. *
  755. * \sa SDL_GetGamepadBindForAxis
  756. */
  757. extern DECLSPEC SDL_GamepadBinding SDLCALL SDL_GetGamepadBindForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
  758. /**
  759. * Query whether a gamepad has a given button.
  760. *
  761. * This merely reports whether the gamepad's mapping defined this button, as
  762. * that is all the information SDL has about the physical device.
  763. *
  764. * \param gamepad a gamepad
  765. * \param button a button enum value (an SDL_GamepadButton value)
  766. * \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise.
  767. *
  768. * \since This function is available since SDL 3.0.0.
  769. */
  770. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
  771. /**
  772. * Get the current state of a button on a gamepad.
  773. *
  774. * \param gamepad a gamepad
  775. * \param button a button index (one of the SDL_GamepadButton values)
  776. * \returns 1 for pressed state or 0 for not pressed state or error; call
  777. * SDL_GetError() for more information.
  778. *
  779. * \since This function is available since SDL 3.0.0.
  780. *
  781. * \sa SDL_GetGamepadAxis
  782. */
  783. extern DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
  784. /**
  785. * Get the number of touchpads on a gamepad.
  786. *
  787. * \param gamepad a gamepad
  788. * \returns number of touchpads
  789. *
  790. * \since This function is available since SDL 3.0.0.
  791. */
  792. extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
  793. /**
  794. * Get the number of supported simultaneous fingers on a touchpad on a game
  795. * gamepad.
  796. *
  797. * \param gamepad a gamepad
  798. * \param touchpad a touchpad
  799. * \returns number of supported simultaneous fingers
  800. *
  801. * \since This function is available since SDL 3.0.0.
  802. */
  803. extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad);
  804. /**
  805. * Get the current state of a finger on a touchpad on a gamepad.
  806. *
  807. * \param gamepad a gamepad
  808. * \param touchpad a touchpad
  809. * \param finger a finger
  810. * \param state filled with state
  811. * \param x filled with x position
  812. * \param y filled with y position
  813. * \param pressure filled with pressure value
  814. * \returns 0 on success or a negative error code on failure; call
  815. * SDL_GetError() for more information.
  816. *
  817. * \since This function is available since SDL 3.0.0.
  818. */
  819. extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
  820. /**
  821. * Return whether a gamepad has a particular sensor.
  822. *
  823. * \param gamepad The gamepad to query
  824. * \param type The type of sensor to query
  825. * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
  826. *
  827. * \since This function is available since SDL 3.0.0.
  828. */
  829. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
  830. /**
  831. * Set whether data reporting for a gamepad sensor is enabled.
  832. *
  833. * \param gamepad The gamepad to update
  834. * \param type The type of sensor to enable/disable
  835. * \param enabled Whether data reporting should be enabled
  836. * \returns 0 on success or a negative error code on failure; call
  837. * SDL_GetError() for more information.
  838. *
  839. * \since This function is available since SDL 3.0.0.
  840. */
  841. extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
  842. /**
  843. * Query whether sensor data reporting is enabled for a gamepad.
  844. *
  845. * \param gamepad The gamepad to query
  846. * \param type The type of sensor to query
  847. * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
  848. *
  849. * \since This function is available since SDL 3.0.0.
  850. */
  851. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
  852. /**
  853. * Get the data rate (number of events per second) of a gamepad sensor.
  854. *
  855. * \param gamepad The gamepad to query
  856. * \param type The type of sensor to query
  857. * \returns the data rate, or 0.0f if the data rate is not available.
  858. *
  859. * \since This function is available since SDL 3.0.0.
  860. */
  861. extern DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type);
  862. /**
  863. * Get the current state of a gamepad sensor.
  864. *
  865. * The number of values and interpretation of the data is sensor dependent.
  866. * See SDL_sensor.h for the details for each type of sensor.
  867. *
  868. * \param gamepad The gamepad to query
  869. * \param type The type of sensor to query
  870. * \param data A pointer filled with the current sensor state
  871. * \param num_values The number of values to write to data
  872. * \returns 0 on success or a negative error code on failure; call
  873. * SDL_GetError() for more information.
  874. *
  875. * \since This function is available since SDL 3.0.0.
  876. */
  877. extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
  878. /**
  879. * Start a rumble effect on a gamepad.
  880. *
  881. * Each call to this function cancels any previous rumble effect, and calling
  882. * it with 0 intensity stops any rumbling.
  883. *
  884. * \param gamepad The gamepad to vibrate
  885. * \param low_frequency_rumble The intensity of the low frequency (left)
  886. * rumble motor, from 0 to 0xFFFF
  887. * \param high_frequency_rumble The intensity of the high frequency (right)
  888. * rumble motor, from 0 to 0xFFFF
  889. * \param duration_ms The duration of the rumble effect, in milliseconds
  890. * \returns 0, or -1 if rumble isn't supported on this gamepad
  891. *
  892. * \since This function is available since SDL 3.0.0.
  893. *
  894. * \sa SDL_GamepadHasRumble
  895. */
  896. extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
  897. /**
  898. * Start a rumble effect in the gamepad's triggers.
  899. *
  900. * Each call to this function cancels any previous trigger rumble effect, and
  901. * calling it with 0 intensity stops any rumbling.
  902. *
  903. * Note that this is rumbling of the _triggers_ and not the gamepad as a
  904. * whole. This is currently only supported on Xbox One gamepads. If you want
  905. * the (more common) whole-gamepad rumble, use SDL_RumbleGamepad() instead.
  906. *
  907. * \param gamepad The gamepad to vibrate
  908. * \param left_rumble The intensity of the left trigger rumble motor, from 0
  909. * to 0xFFFF
  910. * \param right_rumble The intensity of the right trigger rumble motor, from 0
  911. * to 0xFFFF
  912. * \param duration_ms The duration of the rumble effect, in milliseconds
  913. * \returns 0 on success or a negative error code on failure; call
  914. * SDL_GetError() for more information.
  915. *
  916. * \since This function is available since SDL 3.0.0.
  917. *
  918. * \sa SDL_GamepadHasRumbleTriggers
  919. */
  920. extern DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
  921. /**
  922. * Query whether a gamepad has an LED.
  923. *
  924. * \param gamepad The gamepad to query
  925. * \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have a modifiable
  926. * LED
  927. *
  928. * \since This function is available since SDL 3.0.0.
  929. */
  930. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasLED(SDL_Gamepad *gamepad);
  931. /**
  932. * Query whether a gamepad has rumble support.
  933. *
  934. * \param gamepad The gamepad to query
  935. * \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have rumble
  936. * support
  937. *
  938. * \since This function is available since SDL 3.0.0.
  939. *
  940. * \sa SDL_RumbleGamepad
  941. */
  942. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumble(SDL_Gamepad *gamepad);
  943. /**
  944. * Query whether a gamepad has rumble support on triggers.
  945. *
  946. * \param gamepad The gamepad to query
  947. * \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have trigger
  948. * rumble support
  949. *
  950. * \since This function is available since SDL 3.0.0.
  951. *
  952. * \sa SDL_RumbleGamepadTriggers
  953. */
  954. extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumbleTriggers(SDL_Gamepad *gamepad);
  955. /**
  956. * Update a gamepad's LED color.
  957. *
  958. * \param gamepad The gamepad to update
  959. * \param red The intensity of the red LED
  960. * \param green The intensity of the green LED
  961. * \param blue The intensity of the blue LED
  962. * \returns 0 on success or a negative error code on failure; call
  963. * SDL_GetError() for more information.
  964. *
  965. * \since This function is available since SDL 3.0.0.
  966. */
  967. extern DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
  968. /**
  969. * Send a gamepad specific effect packet
  970. *
  971. * \param gamepad The gamepad to affect
  972. * \param data The data to send to the gamepad
  973. * \param size The size of the data to send to the gamepad
  974. * \returns 0 on success or a negative error code on failure; call
  975. * SDL_GetError() for more information.
  976. *
  977. * \since This function is available since SDL 3.0.0.
  978. */
  979. extern DECLSPEC int SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
  980. /**
  981. * Close a gamepad previously opened with SDL_OpenGamepad().
  982. *
  983. * \param gamepad a gamepad identifier previously returned by
  984. * SDL_OpenGamepad()
  985. *
  986. * \since This function is available since SDL 3.0.0.
  987. *
  988. * \sa SDL_OpenGamepad
  989. */
  990. extern DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad);
  991. /**
  992. * Return the sfSymbolsName for a given button on a gamepad on Apple
  993. * platforms.
  994. *
  995. * \param gamepad the gamepad to query
  996. * \param button a button on the gamepad
  997. * \returns the sfSymbolsName or NULL if the name can't be found
  998. *
  999. * \since This function is available since SDL 3.0.0.
  1000. *
  1001. * \sa SDL_GetGamepadAppleSFSymbolsNameForAxis
  1002. */
  1003. extern DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
  1004. /**
  1005. * Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.
  1006. *
  1007. * \param gamepad the gamepad to query
  1008. * \param axis an axis on the gamepad
  1009. * \returns the sfSymbolsName or NULL if the name can't be found
  1010. *
  1011. * \since This function is available since SDL 3.0.0.
  1012. *
  1013. * \sa SDL_GetGamepadAppleSFSymbolsNameForButton
  1014. */
  1015. extern DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
  1016. /* Ends C function definitions when using C++ */
  1017. #ifdef __cplusplus
  1018. }
  1019. #endif
  1020. #include <SDL3/SDL_close_code.h>
  1021. #endif /* SDL_gamepad_h_ */