SDL_keyboard.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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. * # CategoryKeyboard
  20. *
  21. * SDL keyboard management.
  22. */
  23. #ifndef SDL_keyboard_h_
  24. #define SDL_keyboard_h_
  25. #include <SDL3/SDL_stdinc.h>
  26. #include <SDL3/SDL_error.h>
  27. #include <SDL3/SDL_keycode.h>
  28. #include <SDL3/SDL_video.h>
  29. #include <SDL3/SDL_begin_code.h>
  30. /* Set up for C function definitions, even when using C++ */
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /**
  35. * This is a unique ID for a keyboard for the time it is connected to the
  36. * system, and is never reused for the lifetime of the application.
  37. *
  38. * If the keyboard is disconnected and reconnected, it will get a new ID.
  39. *
  40. * The value 0 is an invalid ID.
  41. *
  42. * \since This datatype is available since SDL 3.0.0.
  43. */
  44. typedef Uint32 SDL_KeyboardID;
  45. /* Function prototypes */
  46. /**
  47. * Return whether a keyboard is currently connected.
  48. *
  49. * \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise.
  50. *
  51. * \since This function is available since SDL 3.0.0.
  52. *
  53. * \sa SDL_GetKeyboards
  54. */
  55. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
  56. /**
  57. * Get a list of currently connected keyboards.
  58. *
  59. * Note that this will include any device or virtual driver that includes
  60. * keyboard functionality, including some mice, KVM switches, motherboard
  61. * power buttons, etc. You should wait for input from a device before you
  62. * consider it actively in use.
  63. *
  64. * \param count a pointer filled in with the number of keyboards returned, may
  65. * be NULL.
  66. * \returns a 0 terminated array of keyboards instance IDs or NULL on failure;
  67. * call SDL_GetError() for more information. This should be freed
  68. * with SDL_free() when it is no longer needed.
  69. *
  70. * \since This function is available since SDL 3.0.0.
  71. *
  72. * \sa SDL_GetKeyboardNameForID
  73. * \sa SDL_HasKeyboard
  74. */
  75. extern SDL_DECLSPEC SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count);
  76. /**
  77. * Get the name of a keyboard.
  78. *
  79. * This function returns "" if the keyboard doesn't have a name.
  80. *
  81. * \param instance_id the keyboard instance ID.
  82. * \returns the name of the selected keyboard or NULL on failure; call
  83. * SDL_GetError() for more information.
  84. *
  85. * \since This function is available since SDL 3.0.0.
  86. *
  87. * \sa SDL_GetKeyboards
  88. */
  89. extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id);
  90. /**
  91. * Query the window which currently has keyboard focus.
  92. *
  93. * \returns the window with keyboard focus.
  94. *
  95. * \since This function is available since SDL 3.0.0.
  96. */
  97. extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
  98. /**
  99. * Get a snapshot of the current state of the keyboard.
  100. *
  101. * The pointer returned is a pointer to an internal SDL array. It will be
  102. * valid for the whole lifetime of the application and should not be freed by
  103. * the caller.
  104. *
  105. * A array element with a value of 1 means that the key is pressed and a value
  106. * of 0 means that it is not. Indexes into this array are obtained by using
  107. * SDL_Scancode values.
  108. *
  109. * Use SDL_PumpEvents() to update the state array.
  110. *
  111. * This function gives you the current state after all events have been
  112. * processed, so if a key or button has been pressed and released before you
  113. * process events, then the pressed state will never show up in the
  114. * SDL_GetKeyboardState() calls.
  115. *
  116. * Note: This function doesn't take into account whether shift has been
  117. * pressed or not.
  118. *
  119. * \param numkeys if non-NULL, receives the length of the returned array.
  120. * \returns a pointer to an array of key states.
  121. *
  122. * \since This function is available since SDL 3.0.0.
  123. *
  124. * \sa SDL_PumpEvents
  125. * \sa SDL_ResetKeyboard
  126. */
  127. extern SDL_DECLSPEC const Uint8 * SDLCALL SDL_GetKeyboardState(int *numkeys);
  128. /**
  129. * Clear the state of the keyboard.
  130. *
  131. * This function will generate key up events for all pressed keys.
  132. *
  133. * \since This function is available since SDL 3.0.0.
  134. *
  135. * \sa SDL_GetKeyboardState
  136. */
  137. extern SDL_DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
  138. /**
  139. * Get the current key modifier state for the keyboard.
  140. *
  141. * \returns an OR'd combination of the modifier keys for the keyboard. See
  142. * SDL_Keymod for details.
  143. *
  144. * \since This function is available since SDL 3.0.0.
  145. *
  146. * \sa SDL_GetKeyboardState
  147. * \sa SDL_SetModState
  148. */
  149. extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
  150. /**
  151. * Set the current key modifier state for the keyboard.
  152. *
  153. * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose
  154. * modifier key states on your application. Simply pass your desired modifier
  155. * states into `modstate`. This value may be a bitwise, OR'd combination of
  156. * SDL_Keymod values.
  157. *
  158. * This does not change the keyboard state, only the key modifier flags that
  159. * SDL reports.
  160. *
  161. * \param modstate the desired SDL_Keymod for the keyboard.
  162. *
  163. * \since This function is available since SDL 3.0.0.
  164. *
  165. * \sa SDL_GetModState
  166. */
  167. extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
  168. /**
  169. * Get the key code corresponding to the given scancode according to the
  170. * current keyboard layout.
  171. *
  172. * If you want to get the keycode as it would be delivered in key events,
  173. * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should
  174. * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the
  175. * scancode based on the given modifier state.
  176. *
  177. * \param scancode the desired SDL_Scancode to query.
  178. * \param modstate the modifier state to use when translating the scancode to
  179. * a keycode.
  180. * \param key_event SDL_TRUE if the keycode will be used in key events.
  181. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
  182. *
  183. * \since This function is available since SDL 3.0.0.
  184. *
  185. * \sa SDL_GetKeyName
  186. * \sa SDL_GetScancodeFromKey
  187. */
  188. extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event);
  189. /**
  190. * Get the scancode corresponding to the given key code according to the
  191. * current keyboard layout.
  192. *
  193. * Note that there may be multiple scancode+modifier states that can generate
  194. * this keycode, this will just return the first one found.
  195. *
  196. * \param key the desired SDL_Keycode to query.
  197. * \param modstate a pointer to the modifier state that would be used when the
  198. * scancode generates this key, may be NULL.
  199. * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
  200. *
  201. * \since This function is available since SDL 3.0.0.
  202. *
  203. * \sa SDL_GetKeyFromScancode
  204. * \sa SDL_GetScancodeName
  205. */
  206. extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate);
  207. /**
  208. * Set a human-readable name for a scancode.
  209. *
  210. * \param scancode the desired SDL_Scancode.
  211. * \param name the name to use for the scancode, encoded as UTF-8. The string
  212. * is not copied, so the pointer given to this function must stay
  213. * valid while SDL is being used.
  214. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  215. * SDL_GetError() for more information.
  216. *
  217. * \since This function is available since SDL 3.0.0.
  218. *
  219. * \sa SDL_GetScancodeName
  220. */
  221. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
  222. /**
  223. * Get a human-readable name for a scancode.
  224. *
  225. * **Warning**: The returned name is by design not stable across platforms,
  226. * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left
  227. * Windows" under Microsoft Windows, and some scancodes like
  228. * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even
  229. * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and
  230. * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore
  231. * unsuitable for creating a stable cross-platform two-way mapping between
  232. * strings and scancodes.
  233. *
  234. * \param scancode the desired SDL_Scancode to query.
  235. * \returns a pointer to the name for the scancode. If the scancode doesn't
  236. * have a name this function returns an empty string ("").
  237. *
  238. * \since This function is available since SDL 3.0.0.
  239. *
  240. * \sa SDL_GetScancodeFromKey
  241. * \sa SDL_GetScancodeFromName
  242. * \sa SDL_SetScancodeName
  243. */
  244. extern SDL_DECLSPEC const char * SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
  245. /**
  246. * Get a scancode from a human-readable name.
  247. *
  248. * \param name the human-readable scancode name.
  249. * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
  250. * recognized; call SDL_GetError() for more information.
  251. *
  252. * \since This function is available since SDL 3.0.0.
  253. *
  254. * \sa SDL_GetKeyFromName
  255. * \sa SDL_GetScancodeFromKey
  256. * \sa SDL_GetScancodeName
  257. */
  258. extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
  259. /**
  260. * Get a human-readable name for a key.
  261. *
  262. * If the key doesn't have a name, this function returns an empty string ("").
  263. *
  264. * \param key the desired SDL_Keycode to query.
  265. * \returns a UTF-8 encoded string of the key name.
  266. *
  267. * \since This function is available since SDL 3.0.0.
  268. *
  269. * \sa SDL_GetKeyFromName
  270. * \sa SDL_GetKeyFromScancode
  271. * \sa SDL_GetScancodeFromKey
  272. */
  273. extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyName(SDL_Keycode key);
  274. /**
  275. * Get a key code from a human-readable name.
  276. *
  277. * \param name the human-readable key name.
  278. * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
  279. * SDL_GetError() for more information.
  280. *
  281. * \since This function is available since SDL 3.0.0.
  282. *
  283. * \sa SDL_GetKeyFromScancode
  284. * \sa SDL_GetKeyName
  285. * \sa SDL_GetScancodeFromName
  286. */
  287. extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
  288. /**
  289. * Start accepting Unicode text input events in a window.
  290. *
  291. * This function will enable text input (SDL_EVENT_TEXT_INPUT and
  292. * SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this
  293. * function paired with SDL_StopTextInput().
  294. *
  295. * Text input events are not received by default.
  296. *
  297. * On some platforms using this function shows the screen keyboard.
  298. *
  299. * \param window the window to enable text input.
  300. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  301. * SDL_GetError() for more information.
  302. *
  303. * \since This function is available since SDL 3.0.0.
  304. *
  305. * \sa SDL_SetTextInputArea
  306. * \sa SDL_StartTextInputWithProperties
  307. * \sa SDL_StopTextInput
  308. * \sa SDL_TextInputActive
  309. */
  310. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInput(SDL_Window *window);
  311. /**
  312. * Text input type.
  313. *
  314. * These are the valid values for SDL_PROP_TEXTINPUT_TYPE_NUMBER. Not every
  315. * value is valid on every platform, but where a value isn't supported, a
  316. * reasonable fallback will be used.
  317. *
  318. * \since This enum is available since SDL 3.0.0.
  319. *
  320. * \sa SDL_StartTextInputWithProperties
  321. */
  322. typedef enum SDL_TextInputType
  323. {
  324. SDL_TEXTINPUT_TYPE_TEXT, /**< The input is text */
  325. SDL_TEXTINPUT_TYPE_TEXT_NAME, /**< The input is a person's name */
  326. SDL_TEXTINPUT_TYPE_TEXT_EMAIL, /**< The input is an e-mail address */
  327. SDL_TEXTINPUT_TYPE_TEXT_USERNAME, /**< The input is a username */
  328. SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN, /**< The input is a secure password that is hidden */
  329. SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE, /**< The input is a secure password that is visible */
  330. SDL_TEXTINPUT_TYPE_NUMBER, /**< The input is a number */
  331. SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN, /**< The input is a secure PIN that is hidden */
  332. SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE /**< The input is a secure PIN that is visible */
  333. } SDL_TextInputType;
  334. /**
  335. * Auto capitalization type.
  336. *
  337. * These are the valid values for
  338. * SDL_PROP_TEXTINPUT_AUTOCAPITALIZATION_NUMBER. Not every value is valid on
  339. * every platform, but where a value isn't supported, a reasonable fallback
  340. * will be used.
  341. *
  342. * \since This enum is available since SDL 3.0.0.
  343. *
  344. * \sa SDL_StartTextInputWithProperties
  345. */
  346. typedef enum SDL_Capitalization
  347. {
  348. SDL_CAPITALIZE_NONE, /**< No auto-capitalization will be done */
  349. SDL_CAPITALIZE_SENTENCES, /**< The first letter of sentences will be capitalized */
  350. SDL_CAPITALIZE_WORDS, /**< The first letter of words will be capitalized */
  351. SDL_CAPITALIZE_LETTERS /**< All letters will be capitalized */
  352. } SDL_Capitalization;
  353. /**
  354. * Start accepting Unicode text input events in a window, with properties
  355. * describing the input.
  356. *
  357. * This function will enable text input (SDL_EVENT_TEXT_INPUT and
  358. * SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this
  359. * function paired with SDL_StopTextInput().
  360. *
  361. * Text input events are not received by default.
  362. *
  363. * On some platforms using this function shows the screen keyboard.
  364. *
  365. * These are the supported properties:
  366. *
  367. * - `SDL_PROP_TEXTINPUT_TYPE_NUMBER` - an SDL_TextInputType value that
  368. * describes text being input, defaults to SDL_TEXTINPUT_TYPE_TEXT.
  369. * - `SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER` - an SDL_Capitalization value
  370. * that describes how text should be capitalized, defaults to
  371. * SDL_CAPITALIZE_SENTENCES for normal text entry, SDL_CAPITALIZE_WORDS for
  372. * SDL_TEXTINPUT_TYPE_TEXT_NAME, and SDL_CAPITALIZE_NONE for e-mail
  373. * addresses, usernames, and passwords.
  374. * - `SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN` - true to enable auto completion
  375. * and auto correction, defaults to SDL_TRUE.
  376. * - `SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN` - true if multiple lines of text
  377. * are allowed. This defaults to SDL_TRUE if SDL_HINT_RETURN_KEY_HIDES_IME
  378. * is "0" or is not set, and defaults to SDL_FALSE if
  379. * SDL_HINT_RETURN_KEY_HIDES_IME is "1".
  380. *
  381. * On Android you can directly specify the input type:
  382. *
  383. * - `SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER` - the text input type to
  384. * use, overriding other properties. This is documented at
  385. * https://developer.android.com/reference/android/text/InputType
  386. *
  387. * \param window the window to enable text input.
  388. * \param props the properties to use.
  389. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  390. * SDL_GetError() for more information.
  391. *
  392. * \since This function is available since SDL 3.0.0.
  393. *
  394. * \sa SDL_SetTextInputArea
  395. * \sa SDL_StartTextInput
  396. * \sa SDL_StopTextInput
  397. * \sa SDL_TextInputActive
  398. */
  399. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
  400. #define SDL_PROP_TEXTINPUT_TYPE_NUMBER "SDL.textinput.type"
  401. #define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization"
  402. #define SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN "SDL.textinput.autocorrect"
  403. #define SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN "SDL.textinput.multiline"
  404. #define SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER "SDL.textinput.android.inputtype"
  405. /**
  406. * Check whether or not Unicode text input events are enabled for a window.
  407. *
  408. * \param window the window to check.
  409. * \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
  410. *
  411. * \since This function is available since SDL 3.0.0.
  412. *
  413. * \sa SDL_StartTextInput
  414. */
  415. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
  416. /**
  417. * Stop receiving any text input events in a window.
  418. *
  419. * If SDL_StartTextInput() showed the screen keyboard, this function will hide
  420. * it.
  421. *
  422. * \param window the window to disable text input.
  423. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  424. * SDL_GetError() for more information.
  425. *
  426. * \since This function is available since SDL 3.0.0.
  427. *
  428. * \sa SDL_StartTextInput
  429. */
  430. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
  431. /**
  432. * Dismiss the composition window/IME without disabling the subsystem.
  433. *
  434. * \param window the window to affect.
  435. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  436. * SDL_GetError() for more information.
  437. *
  438. * \since This function is available since SDL 3.0.0.
  439. *
  440. * \sa SDL_StartTextInput
  441. * \sa SDL_StopTextInput
  442. */
  443. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
  444. /**
  445. * Set the area used to type Unicode text input.
  446. *
  447. * Native input methods may place a window with word suggestions near the
  448. * cursor, without covering the text being entered.
  449. *
  450. * \param window the window for which to set the text input area.
  451. * \param rect the SDL_Rect representing the text input area, in window
  452. * coordinates, or NULL to clear it.
  453. * \param cursor the offset of the current cursor location relative to
  454. * `rect->x`, in window coordinates.
  455. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  456. * SDL_GetError() for more information.
  457. *
  458. * \since This function is available since SDL 3.0.0.
  459. *
  460. * \sa SDL_GetTextInputArea
  461. * \sa SDL_StartTextInput
  462. */
  463. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
  464. /**
  465. * Get the area used to type Unicode text input.
  466. *
  467. * This returns the values previously set by SDL_SetTextInputArea().
  468. *
  469. * \param window the window for which to query the text input area.
  470. * \param rect a pointer to an SDL_Rect filled in with the text input area,
  471. * may be NULL.
  472. * \param cursor a pointer to the offset of the current cursor location
  473. * relative to `rect->x`, may be NULL.
  474. * \returns SDL_TRUE on success or SDL_FALSE on failure; call
  475. * SDL_GetError() for more information.
  476. *
  477. * \since This function is available since SDL 3.0.0.
  478. *
  479. * \sa SDL_SetTextInputArea
  480. */
  481. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
  482. /**
  483. * Check whether the platform has screen keyboard support.
  484. *
  485. * \returns SDL_TRUE if the platform has some screen keyboard support or
  486. * SDL_FALSE if not.
  487. *
  488. * \since This function is available since SDL 3.0.0.
  489. *
  490. * \sa SDL_StartTextInput
  491. * \sa SDL_ScreenKeyboardShown
  492. */
  493. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
  494. /**
  495. * Check whether the screen keyboard is shown for given window.
  496. *
  497. * \param window the window for which screen keyboard should be queried.
  498. * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
  499. *
  500. * \since This function is available since SDL 3.0.0.
  501. *
  502. * \sa SDL_HasScreenKeyboardSupport
  503. */
  504. extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
  505. /* Ends C function definitions when using C++ */
  506. #ifdef __cplusplus
  507. }
  508. #endif
  509. #include <SDL3/SDL_close_code.h>
  510. #endif /* SDL_keyboard_h_ */