Hi John, > A wxIdleEvent event is sent after every event or batch of events so > you are guaranteed to get it. You could be "tricked" that a user was > active with your app if a different window is dragged on top and a > paint event sent, but does that matter?
I saw that code, but he is using GetLastInputInfo, which is Windows only and I need something that works on Windows, OSX, and Linux. It is also tracking *user* idle time (across all applications), rather than application idle time (which is what I am after). I also couldn't get wxIdleEvent to work as I'd expect, because it's always generated on Windows (I get a stream of IDLE events), but only after some other events on OSX and Linux (as documented). Also, I registered EVT_KILL_FOCUS handler on the main frame in the application, but it's not triggered when the focus is changed to another application. Right now I simply set a timer for X/2 seconds (where X is the period I want to track) and track document modification events that happen during that time. I don't get the exact interval I need, but it's not critical; I'm never more than X/2 seconds off. I was looking for something more centralized and simpler than what I have now, but couldn't find it. Paul. On Thu, Oct 18, 2012 at 9:43 PM, John Labenski <jlaben...@gmail.com> wrote: > On Thu, Oct 18, 2012 at 11:14 PM, Paul K <paulclin...@yahoo.com> wrote: >> Hi John, >> >>> If you can you explain what you are trying to do I might be able to help. >> >> Sure; I'm trying to detect idle time in the application when a user >> doesn't do any activity for X seconds. Any activity is defined as >> EVT_MOTION and EVT_KEY_DOWN events, but I'll settle for EVT_KEY_DOWN >> if it's difficult to track both. I don't want to keep adding my >> handlers to all the components I have and am looking for as few places >> to modify as possible. > > How about something like this? > http://utmostlogic.wordpress.com/tag/wxwidgets/ > > A wxIdleEvent event is sent after every event or batch of events so > you are guaranteed to get it. You could be "tricked" that a user was > active with your app if a different window is dragged on top and a > paint event sent, but does that matter? > > Regards, > John > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > wxlua-users mailing list > wxlua-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wxlua-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users