Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Idle time calculation
Message
From
27/05/2004 18:15:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/05/2004 09:53:50
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00907707
Message ID:
00907982
Views:
7
>Hi all ...
>
>I'm looking for a way of calculating the time a PC has been left idle (ie no keyboard / mouse action) in a VFP 8.0 environment. I'm sure is probably easily acheived, but just wondered if someone could give me a quick fix.

Set each of your forms to have keypreview=.t., and have a bit of code which will call something in your application object.
Your app object can use seconds() to store the time of last call, and on each call compare that stored time with the current time, do something with the difference (save in a table?), store current time in the property and so on. I think this is simpler than the timers.

The problem is more in the area of what counts as an user interaction - each click, unregistered clicks or keypresses that end a wait command, responses to messagebox()... even responses to the file selector when it appears. I.e. it's easy to do for your forms, even menus, but it's hard to cover all the possible cases.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform