SDL_HINT_RETURN_KEY_HIDES_IME(3)

πŸ’– SDL_HINT_RETURN_KEY_HIDES_IME πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's a lil hint page and it's genuinely so useful if you're doing mobile stuff 🫢


✨ NAME ✨

SDL_HINT_RETURN_KEY_HIDES_IME β€” it's a variable that controls whether the return key on the soft keyboard should hide the soft keyboard, specifically on Android and iOS. like, should that lil return key yeet the keyboard away or not, that's the whole question πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME"

no cap, that's the whole thing, you just pull it in and use the string πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this hint sets the default value of SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN. lowkey important, so don't sleep on it.

the variable can be set to the following values:

  • "0" β€” the return key gets handled as a key event. (this is the default, bestie, if you don't set anything this is what you get ✨)
  • "1" β€” the return key will hide the keyboard. poof, gone, keyboard cancelled πŸ’€

and the best part?? this hint can be set anytime. no timing drama, no "omg did I set it too late", you're free 🧚


⭐ AVAILABILITY ⭐

this hint is available since SDL 3.2.0. if you're on something older, sorry babe, it's not there yet 😭


πŸ’‘ quick vibe check: "0" = return key does its key event thing, "1" = return key nukes the keyboard. defaults to "0". that's it, that's the page πŸŽ€

k bye ily, go forth and make your mobile text input behave 🫢 this was Simple Directmedia Layer, SDL 3.4.18, page SDL_HINT_RETURN_KEY_HIDES_IME(3) β€” mwah πŸ’‹

πŸ“¦ where this page comes from