SDL 3.0
SDL_keyboard.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * # CategoryKeyboard
24 *
25 * SDL keyboard management.
26 *
27 * Please refer to the Best Keyboard Practices document for details on how
28 * best to accept keyboard input in various types of programs:
29 *
30 * https://wiki.libsdl.org/SDL3/BestKeyboardPractices
31 */
32
33#ifndef SDL_keyboard_h_
34#define SDL_keyboard_h_
35
36#include <SDL3/SDL_stdinc.h>
37#include <SDL3/SDL_error.h>
38#include <SDL3/SDL_keycode.h>
39#include <SDL3/SDL_properties.h>
40#include <SDL3/SDL_rect.h>
41#include <SDL3/SDL_scancode.h>
42#include <SDL3/SDL_video.h>
43
44#include <SDL3/SDL_begin_code.h>
45/* Set up for C function definitions, even when using C++ */
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/**
51 * This is a unique ID for a keyboard for the time it is connected to the
52 * system, and is never reused for the lifetime of the application.
53 *
54 * If the keyboard is disconnected and reconnected, it will get a new ID.
55 *
56 * The value 0 is an invalid ID.
57 *
58 * \since This datatype is available since SDL 3.2.0.
59 */
61
62/* Function prototypes */
63
64/**
65 * Return whether a keyboard is currently connected.
66 *
67 * \returns true if a keyboard is connected, false otherwise.
68 *
69 * \threadsafety This function should only be called on the main thread.
70 *
71 * \since This function is available since SDL 3.2.0.
72 *
73 * \sa SDL_GetKeyboards
74 */
75extern SDL_DECLSPEC bool SDLCALL SDL_HasKeyboard(void);
76
77/**
78 * Get a list of currently connected keyboards.
79 *
80 * Note that this will include any device or virtual driver that includes
81 * keyboard functionality, including some mice, KVM switches, motherboard
82 * power buttons, etc. You should wait for input from a device before you
83 * consider it actively in use.
84 *
85 * \param count a pointer filled in with the number of keyboards returned, may
86 * be NULL.
87 * \returns a 0 terminated array of keyboards instance IDs or NULL on failure;
88 * call SDL_GetError() for more information. This should be freed
89 * with SDL_free() when it is no longer needed.
90 *
91 * \threadsafety This function should only be called on the main thread.
92 *
93 * \since This function is available since SDL 3.2.0.
94 *
95 * \sa SDL_GetKeyboardNameForID
96 * \sa SDL_HasKeyboard
97 */
98extern SDL_DECLSPEC SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count);
99
100/**
101 * Get the name of a keyboard.
102 *
103 * This function returns "" if the keyboard doesn't have a name.
104 *
105 * \param instance_id the keyboard instance ID.
106 * \returns the name of the selected keyboard or NULL on failure; call
107 * SDL_GetError() for more information.
108 *
109 * \threadsafety This function should only be called on the main thread.
110 *
111 * \since This function is available since SDL 3.2.0.
112 *
113 * \sa SDL_GetKeyboards
114 */
115extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id);
116
117/**
118 * Query the window which currently has keyboard focus.
119 *
120 * \returns the window with keyboard focus.
121 *
122 * \threadsafety This function should only be called on the main thread.
123 *
124 * \since This function is available since SDL 3.2.0.
125 */
126extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
127
128/**
129 * Get a snapshot of the current state of the keyboard.
130 *
131 * The pointer returned is a pointer to an internal SDL array. It will be
132 * valid for the whole lifetime of the application and should not be freed by
133 * the caller.
134 *
135 * A array element with a value of true means that the key is pressed and a
136 * value of false means that it is not. Indexes into this array are obtained
137 * by using SDL_Scancode values.
138 *
139 * Use SDL_PumpEvents() to update the state array.
140 *
141 * This function gives you the current state after all events have been
142 * processed, so if a key or button has been pressed and released before you
143 * process events, then the pressed state will never show up in the
144 * SDL_GetKeyboardState() calls.
145 *
146 * Note: This function doesn't take into account whether shift has been
147 * pressed or not.
148 *
149 * Note that this function is "thread safe," in that calling it from two
150 * threads at once will return the same array and that it won't be reallocated
151 * or free'd without warning, as more events arrive, the contents of this
152 * array may change without warning or any sort of thread synchronization. For
153 * apps that need precision, it is better to use the key events in the SDL
154 * event queue.
155 *
156 * \param numkeys if non-NULL, receives the length of the returned array.
157 * \returns a pointer to an array of key states.
158 *
159 * \threadsafety It is safe to call this function from any thread.
160 *
161 * \since This function is available since SDL 3.2.0.
162 *
163 * \sa SDL_PumpEvents
164 * \sa SDL_ResetKeyboard
165 */
166extern SDL_DECLSPEC const bool * SDLCALL SDL_GetKeyboardState(int *numkeys);
167
168/**
169 * Clear the state of the keyboard.
170 *
171 * This function will generate key up events for all pressed keys.
172 *
173 * \threadsafety This function should only be called on the main thread.
174 *
175 * \since This function is available since SDL 3.2.0.
176 *
177 * \sa SDL_GetKeyboardState
178 */
179extern SDL_DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
180
181/**
182 * Get the current key modifier state for the keyboard.
183 *
184 * \returns an OR'd combination of the modifier keys for the keyboard.
185 *
186 * \threadsafety It is safe to call this function from any thread.
187 *
188 * \since This function is available since SDL 3.2.0.
189 *
190 * \sa SDL_GetKeyboardState
191 * \sa SDL_SetModState
192 */
193extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
194
195/**
196 * Set the current key modifier state for the keyboard.
197 *
198 * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose
199 * modifier key states on your application. Simply pass your desired modifier
200 * states into `modstate`. This value may be a bitwise, OR'd combination of
201 * SDL_Keymod values.
202 *
203 * This does not change the keyboard state, only the key modifier flags that
204 * SDL reports.
205 *
206 * \param modstate the desired SDL_Keymod for the keyboard.
207 *
208 * \threadsafety It is safe to call this function from any thread.
209 *
210 * \since This function is available since SDL 3.2.0.
211 *
212 * \sa SDL_GetModState
213 */
214extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
215
216/**
217 * Get the key code corresponding to the given scancode according to the
218 * current keyboard layout.
219 *
220 * If you want to get the keycode as it would be delivered in key events,
221 * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should
222 * pass `key_event` as true. Otherwise this function simply translates the
223 * scancode based on the given modifier state.
224 *
225 * \param scancode the desired SDL_Scancode to query.
226 * \param modstate the modifier state to use when translating the scancode to
227 * a keycode.
228 * \param key_event true if the keycode will be used in key events.
229 * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
230 *
231 * \threadsafety This function is not thread safe.
232 *
233 * \since This function is available since SDL 3.2.0.
234 *
235 * \sa SDL_GetKeyName
236 * \sa SDL_GetScancodeFromKey
237 */
238extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event);
239
240/**
241 * Get the scancode corresponding to the given key code according to the
242 * current keyboard layout.
243 *
244 * Note that there may be multiple scancode+modifier states that can generate
245 * this keycode, this will just return the first one found.
246 *
247 * \param key the desired SDL_Keycode to query.
248 * \param modstate a pointer to the modifier state that would be used when the
249 * scancode generates this key, may be NULL.
250 * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
251 *
252 * \threadsafety This function is not thread safe.
253 *
254 * \since This function is available since SDL 3.2.0.
255 *
256 * \sa SDL_GetKeyFromScancode
257 * \sa SDL_GetScancodeName
258 */
259extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate);
260
261/**
262 * Set a human-readable name for a scancode.
263 *
264 * \param scancode the desired SDL_Scancode.
265 * \param name the name to use for the scancode, encoded as UTF-8. The string
266 * is not copied, so the pointer given to this function must stay
267 * valid while SDL is being used.
268 * \returns true on success or false on failure; call SDL_GetError() for more
269 * information.
270 *
271 * \threadsafety This function is not thread safe.
272 *
273 * \since This function is available since SDL 3.2.0.
274 *
275 * \sa SDL_GetScancodeName
276 */
277extern SDL_DECLSPEC bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
278
279/**
280 * Get a human-readable name for a scancode.
281 *
282 * **Warning**: The returned name is by design not stable across platforms,
283 * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left
284 * Windows" under Microsoft Windows, and some scancodes like
285 * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even
286 * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and
287 * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore
288 * unsuitable for creating a stable cross-platform two-way mapping between
289 * strings and scancodes.
290 *
291 * \param scancode the desired SDL_Scancode to query.
292 * \returns a pointer to the name for the scancode. If the scancode doesn't
293 * have a name this function returns an empty string ("").
294 *
295 * \threadsafety This function is not thread safe.
296 *
297 * \since This function is available since SDL 3.2.0.
298 *
299 * \sa SDL_GetScancodeFromKey
300 * \sa SDL_GetScancodeFromName
301 * \sa SDL_SetScancodeName
302 */
303extern SDL_DECLSPEC const char * SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
304
305/**
306 * Get a scancode from a human-readable name.
307 *
308 * \param name the human-readable scancode name.
309 * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
310 * recognized; call SDL_GetError() for more information.
311 *
312 * \threadsafety This function is not thread safe.
313 *
314 * \since This function is available since SDL 3.2.0.
315 *
316 * \sa SDL_GetKeyFromName
317 * \sa SDL_GetScancodeFromKey
318 * \sa SDL_GetScancodeName
319 */
320extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
321
322/**
323 * Get a human-readable name for a key.
324 *
325 * If the key doesn't have a name, this function returns an empty string ("").
326 *
327 * Letters will be presented in their uppercase form, if applicable.
328 *
329 * \param key the desired SDL_Keycode to query.
330 * \returns a UTF-8 encoded string of the key name.
331 *
332 * \threadsafety This function is not thread safe.
333 *
334 * \since This function is available since SDL 3.2.0.
335 *
336 * \sa SDL_GetKeyFromName
337 * \sa SDL_GetKeyFromScancode
338 * \sa SDL_GetScancodeFromKey
339 */
340extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyName(SDL_Keycode key);
341
342/**
343 * Get a key code from a human-readable name.
344 *
345 * \param name the human-readable key name.
346 * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
347 * SDL_GetError() for more information.
348 *
349 * \threadsafety This function is not thread safe.
350 *
351 * \since This function is available since SDL 3.2.0.
352 *
353 * \sa SDL_GetKeyFromScancode
354 * \sa SDL_GetKeyName
355 * \sa SDL_GetScancodeFromName
356 */
357extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
358
359/**
360 * Start accepting Unicode text input events in a window.
361 *
362 * This function will enable text input (SDL_EVENT_TEXT_INPUT and
363 * SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this
364 * function paired with SDL_StopTextInput().
365 *
366 * Text input events are not received by default.
367 *
368 * On some platforms using this function shows the screen keyboard and/or
369 * activates an IME, which can prevent some key press events from being passed
370 * through.
371 *
372 * \param window the window to enable text input.
373 * \returns true on success or false on failure; call SDL_GetError() for more
374 * information.
375 *
376 * \threadsafety This function should only be called on the main thread.
377 *
378 * \since This function is available since SDL 3.2.0.
379 *
380 * \sa SDL_SetTextInputArea
381 * \sa SDL_StartTextInputWithProperties
382 * \sa SDL_StopTextInput
383 * \sa SDL_TextInputActive
384 */
385extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInput(SDL_Window *window);
386
387/**
388 * Text input type.
389 *
390 * These are the valid values for SDL_PROP_TEXTINPUT_TYPE_NUMBER. Not every
391 * value is valid on every platform, but where a value isn't supported, a
392 * reasonable fallback will be used.
393 *
394 * \since This enum is available since SDL 3.2.0.
395 *
396 * \sa SDL_StartTextInputWithProperties
397 */
399{
400 SDL_TEXTINPUT_TYPE_TEXT, /**< The input is text */
401 SDL_TEXTINPUT_TYPE_TEXT_NAME, /**< The input is a person's name */
402 SDL_TEXTINPUT_TYPE_TEXT_EMAIL, /**< The input is an e-mail address */
403 SDL_TEXTINPUT_TYPE_TEXT_USERNAME, /**< The input is a username */
404 SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN, /**< The input is a secure password that is hidden */
405 SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE, /**< The input is a secure password that is visible */
406 SDL_TEXTINPUT_TYPE_NUMBER, /**< The input is a number */
407 SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN, /**< The input is a secure PIN that is hidden */
408 SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE /**< The input is a secure PIN that is visible */
410
411/**
412 * Auto capitalization type.
413 *
414 * These are the valid values for SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER.
415 * Not every value is valid on every platform, but where a value isn't
416 * supported, a reasonable fallback will be used.
417 *
418 * \since This enum is available since SDL 3.2.0.
419 *
420 * \sa SDL_StartTextInputWithProperties
421 */
423{
424 SDL_CAPITALIZE_NONE, /**< No auto-capitalization will be done */
425 SDL_CAPITALIZE_SENTENCES, /**< The first letter of sentences will be capitalized */
426 SDL_CAPITALIZE_WORDS, /**< The first letter of words will be capitalized */
427 SDL_CAPITALIZE_LETTERS /**< All letters will be capitalized */
429
430/**
431 * Start accepting Unicode text input events in a window, with properties
432 * describing the input.
433 *
434 * This function will enable text input (SDL_EVENT_TEXT_INPUT and
435 * SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this
436 * function paired with SDL_StopTextInput().
437 *
438 * Text input events are not received by default.
439 *
440 * On some platforms using this function shows the screen keyboard and/or
441 * activates an IME, which can prevent some key press events from being passed
442 * through.
443 *
444 * These are the supported properties:
445 *
446 * - `SDL_PROP_TEXTINPUT_TYPE_NUMBER` - an SDL_TextInputType value that
447 * describes text being input, defaults to SDL_TEXTINPUT_TYPE_TEXT.
448 * - `SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER` - an SDL_Capitalization value
449 * that describes how text should be capitalized, defaults to
450 * SDL_CAPITALIZE_SENTENCES for normal text entry, SDL_CAPITALIZE_WORDS for
451 * SDL_TEXTINPUT_TYPE_TEXT_NAME, and SDL_CAPITALIZE_NONE for e-mail
452 * addresses, usernames, and passwords.
453 * - `SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN` - true to enable auto completion
454 * and auto correction, defaults to true.
455 * - `SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN` - true if multiple lines of text
456 * are allowed. This defaults to true if SDL_HINT_RETURN_KEY_HIDES_IME is
457 * "0" or is not set, and defaults to false if SDL_HINT_RETURN_KEY_HIDES_IME
458 * is "1".
459 *
460 * On Android you can directly specify the input type:
461 *
462 * - `SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER` - the text input type to
463 * use, overriding other properties. This is documented at
464 * https://developer.android.com/reference/android/text/InputType
465 *
466 * \param window the window to enable text input.
467 * \param props the properties to use.
468 * \returns true on success or false on failure; call SDL_GetError() for more
469 * information.
470 *
471 * \threadsafety This function should only be called on the main thread.
472 *
473 * \since This function is available since SDL 3.2.0.
474 *
475 * \sa SDL_SetTextInputArea
476 * \sa SDL_StartTextInput
477 * \sa SDL_StopTextInput
478 * \sa SDL_TextInputActive
479 */
480extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
481
482#define SDL_PROP_TEXTINPUT_TYPE_NUMBER "SDL.textinput.type"
483#define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization"
484#define SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN "SDL.textinput.autocorrect"
485#define SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN "SDL.textinput.multiline"
486#define SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER "SDL.textinput.android.inputtype"
487
488/**
489 * Check whether or not Unicode text input events are enabled for a window.
490 *
491 * \param window the window to check.
492 * \returns true if text input events are enabled else false.
493 *
494 * \threadsafety This function should only be called on the main thread.
495 *
496 * \since This function is available since SDL 3.2.0.
497 *
498 * \sa SDL_StartTextInput
499 */
500extern SDL_DECLSPEC bool SDLCALL SDL_TextInputActive(SDL_Window *window);
501
502/**
503 * Stop receiving any text input events in a window.
504 *
505 * If SDL_StartTextInput() showed the screen keyboard, this function will hide
506 * it.
507 *
508 * \param window the window to disable text input.
509 * \returns true on success or false on failure; call SDL_GetError() for more
510 * information.
511 *
512 * \threadsafety This function should only be called on the main thread.
513 *
514 * \since This function is available since SDL 3.2.0.
515 *
516 * \sa SDL_StartTextInput
517 */
518extern SDL_DECLSPEC bool SDLCALL SDL_StopTextInput(SDL_Window *window);
519
520/**
521 * Dismiss the composition window/IME without disabling the subsystem.
522 *
523 * \param window the window to affect.
524 * \returns true on success or false on failure; call SDL_GetError() for more
525 * information.
526 *
527 * \threadsafety This function should only be called on the main thread.
528 *
529 * \since This function is available since SDL 3.2.0.
530 *
531 * \sa SDL_StartTextInput
532 * \sa SDL_StopTextInput
533 */
534extern SDL_DECLSPEC bool SDLCALL SDL_ClearComposition(SDL_Window *window);
535
536/**
537 * Set the area used to type Unicode text input.
538 *
539 * Native input methods may place a window with word suggestions near the
540 * cursor, without covering the text being entered.
541 *
542 * \param window the window for which to set the text input area.
543 * \param rect the SDL_Rect representing the text input area, in window
544 * coordinates, or NULL to clear it.
545 * \param cursor the offset of the current cursor location relative to
546 * `rect->x`, in window coordinates.
547 * \returns true on success or false on failure; call SDL_GetError() for more
548 * information.
549 *
550 * \threadsafety This function should only be called on the main thread.
551 *
552 * \since This function is available since SDL 3.2.0.
553 *
554 * \sa SDL_GetTextInputArea
555 * \sa SDL_StartTextInput
556 */
557extern SDL_DECLSPEC bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
558
559/**
560 * Get the area used to type Unicode text input.
561 *
562 * This returns the values previously set by SDL_SetTextInputArea().
563 *
564 * \param window the window for which to query the text input area.
565 * \param rect a pointer to an SDL_Rect filled in with the text input area,
566 * may be NULL.
567 * \param cursor a pointer to the offset of the current cursor location
568 * relative to `rect->x`, may be NULL.
569 * \returns true on success or false on failure; call SDL_GetError() for more
570 * information.
571 *
572 * \threadsafety This function should only be called on the main thread.
573 *
574 * \since This function is available since SDL 3.2.0.
575 *
576 * \sa SDL_SetTextInputArea
577 */
578extern SDL_DECLSPEC bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
579
580/**
581 * Check whether the platform has screen keyboard support.
582 *
583 * \returns true if the platform has some screen keyboard support or false if
584 * not.
585 *
586 * \threadsafety This function should only be called on the main thread.
587 *
588 * \since This function is available since SDL 3.2.0.
589 *
590 * \sa SDL_StartTextInput
591 * \sa SDL_ScreenKeyboardShown
592 */
593extern SDL_DECLSPEC bool SDLCALL SDL_HasScreenKeyboardSupport(void);
594
595/**
596 * Check whether the screen keyboard is shown for given window.
597 *
598 * \param window the window for which screen keyboard should be queried.
599 * \returns true if screen keyboard is shown or false if not.
600 *
601 * \threadsafety This function should only be called on the main thread.
602 *
603 * \since This function is available since SDL 3.2.0.
604 *
605 * \sa SDL_HasScreenKeyboardSupport
606 */
607extern SDL_DECLSPEC bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
608
609/* Ends C function definitions when using C++ */
610#ifdef __cplusplus
611}
612#endif
613#include <SDL3/SDL_close_code.h>
614
615#endif /* SDL_keyboard_h_ */
SDL_Scancode SDL_GetScancodeFromName(const char *name)
bool SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor)
bool SDL_TextInputActive(SDL_Window *window)
SDL_Keymod SDL_GetModState(void)
SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate)
bool SDL_StopTextInput(SDL_Window *window)
bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
Uint32 SDL_KeyboardID
const char * SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id)
bool SDL_StartTextInput(SDL_Window *window)
bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props)
void SDL_ResetKeyboard(void)
SDL_Window * SDL_GetKeyboardFocus(void)
SDL_TextInputType
@ SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE
@ SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN
@ SDL_TEXTINPUT_TYPE_TEXT_USERNAME
@ SDL_TEXTINPUT_TYPE_TEXT
@ SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN
@ SDL_TEXTINPUT_TYPE_TEXT_EMAIL
@ SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE
@ SDL_TEXTINPUT_TYPE_NUMBER
@ SDL_TEXTINPUT_TYPE_TEXT_NAME
bool SDL_HasKeyboard(void)
void SDL_SetModState(SDL_Keymod modstate)
const char * SDL_GetKeyName(SDL_Keycode key)
SDL_Keycode SDL_GetKeyFromName(const char *name)
bool SDL_ClearComposition(SDL_Window *window)
SDL_Capitalization
@ SDL_CAPITALIZE_LETTERS
@ SDL_CAPITALIZE_SENTENCES
@ SDL_CAPITALIZE_NONE
@ SDL_CAPITALIZE_WORDS
bool SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor)
bool SDL_HasScreenKeyboardSupport(void)
SDL_KeyboardID * SDL_GetKeyboards(int *count)
const bool * SDL_GetKeyboardState(int *numkeys)
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event)
const char * SDL_GetScancodeName(SDL_Scancode scancode)
bool SDL_ScreenKeyboardShown(SDL_Window *window)
Uint16 SDL_Keymod
Uint32 SDL_Keycode
Definition SDL_keycode.h:59
Uint32 SDL_PropertiesID
SDL_Scancode
uint32_t Uint32
Definition SDL_stdinc.h:482
struct SDL_Window SDL_Window
Definition SDL_video.h:175
static SDL_Window * window
Definition hello.c:16