The Idle Detection API provides a means to detect the user’s idle status, active, idle, and locked, specifically, and to be notified of changes to idle status without polling from a script.