Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Calculating Idle Time: (3 Items)
   
Calculating Idle Time  
Can someone give me guidance on generically catching input events for my application?

I need to calculate the idle time of the user. 

My first thought was to create a thread that runs and checks the last active time compared to the current time to 
determine idle time.

However, my issue comes in when I am attempting to set the last active time for the user.  I was planning on adding a 
function to set the time for all of the callbacks for every button in the application, but that seems like a lot to keep
 track of.

Is there a callback that I can set for the entire application, or atleast for every window, that will be called 
everytime the user provides input via the mouse?

Thanks,
Kendall
Re: Calculating Idle Time  
It looks like adding a callback for the Pt_CB_FILTER resource for the events Ph_EV_BUT_PRESS and Ph_EV_BUT_RELEASE is 
almost exactly what I need.

I am having to tweak it some, but it looks like it might just fit my need.

Please let me know if there is another way that might be easier or more accurate.

Thanks,
Kendall
Re: Calculating Idle Time  
That is the way to go. You can also add Ph_EV_KEY handling.