is_foreground
is_foreground(); - this function is used to check that the window has active user input. (available from version 7.0.39)
After testing, the function returns the result of its work to the script :
true – window with active user input
false – window without input