SDL_keyboard.h 20 KB

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