Admittedly I have a problem communicating so allow me to clarify, (what I just said, and the rest of this isn’t meant to sound salty or anything, so I apologize if it does). What I thought I said is that there are these two functions that can start and stop text editing inputs from being created from the Event system. This should do exactly what I believe OP wants them to do. So when your program is not capable of using/handling text events, “game mode”, run the SDL_StopTextInput function. When you need text again, run the SDL_StartTextInput function to start receiving text again.
If that doesn’t work, create a flag for when your game can or cannot handle text events, “game mode”, and have Text Input events ignored if they’re not needed. Do this inside of your text input handler, and I recommend only putting it into the text handling portion to avoid unnecessary checks in the rest of the event handler since “game mode” should be a key part of your program. Here’s some quick C\C++ code as an example:
/* Handle text input events. */
/*Else should not be used since all text events if we're in game mode.*/