Gets the number of milliseconds since the user last used the mouse or keyboard.

Syntax

IdleTime = SRP_Get_IdleTime()

Returns

The number of milliseconds since the user last used the mouse or keyboard.

Remarks

The SRP_Get_IdleTime is useful for detecting whether or not your application has been abandoned by the user. The return value is in milliseconds, but you can easily convert that into seconds, minutes, or even hours. This idle time represents the amount of time since the last keyboard or mouse input across the entire system, not just this application. CPU usage is not considered; only mouse and keyboard input is considered.

Examples

// Get the idle time and convert to minutes
IdleTime = SRP_Get_IdleTime()
IdleTime = Int(IdleTime / 60000)
  • No labels