Samples‎ > ‎WinPack Samples‎ > ‎

Idle Tracker Sample

import com.jniwrapper.win32.hook.IdleTracker;
import com.jniwrapper.win32.hook.IdleTrackerListener;

/**
 * This sample demonstrates to track user idleness using hte IdleTracker class.
 */
public class IdleTrackerSample
{

    public static void main(String[] args)
    {
        IdleTracker idle = new IdleTracker(2000);
        idle.addListener(new IdleTrackerListener()
        {
            public void timeoutElapsed()
            {
                System.out.println("Idle tracker listener...");
            }
        });
        idle.start();
    }
}