SDL_GetAppState man page
SDL_GetAppState — Get the state of the application
This function returns the current state of the application. The value returned is a bitwise combination of:
The application has mouse focus.
The application has keyboard focus
The application is visible