Do you mean the Python API? Seems like it's not possible yet... But I guess in your case, you can just have a global variable in the script (or add some property to a WindowManager) and set it to True/False accordingly.