SDL_StopTextInput(3)

πŸ’– SDL_StopTextInput πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_StopTextInput β€” the one that stops your window from receiving any text input events. no cap. she's the off switch. πŸ’…


✨ NAME ✨

SDL_StopTextInput β€” stop receiving any text input events in a window. πŸ›‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_keyboard.h>

bool SDL_StopTextInput(SDL_Window *window);

🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” if SDL_StartTextInput() was the one that showed the screen keyboard, this function is the one that hides it. that's it. that's the whole vibe. she takes it away. poof. πŸͺ„


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • window β€” the window you wanna disable text input on. that's the target, bestie. 🎯

⭐ RETURN VALUE ⭐

returns true on success, or false on failure. 😭 and if it fails? call SDL_GetError() for more info, because she will tell you what went wrong. iykyk. πŸ”


πŸ”₯ THREAD SAFETY πŸ”₯

bestie, listen to me on this one: this function should only be called on the main thread. do not try her from a side thread. she is not built for that. periodt. πŸ’€

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on anything older, she simply does not exist yet, sorry. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_StartTextInput(3) β€” the other half of this duo, the one that turns it ON. go read her too, they're a matching set. 🫢

and that's the whole page, angel ✨ β€” this lil rewrite lives under the Simple Directmedia Layer banner, from the SDL 3.4.18 era. now go forth and stop that text input, you absolute icon. πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from