Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus - How to detect if a user has been idle

1 Posts
1 Users
0 Reactions
3,128 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

In my application, I'd like do something when a user has been inactive/idle for a while - in this case, I want the application to actually lock and request a pincode or password to let the user back in again.

This kept me busy for quite a while, just to find out that there is a hidden gem in Lazarus Pascal that does it all ...

Simply use TIdleTime, set the proper Interval (in milliseconds) and set Enabled:=TRUE and AutoEnabled:=TRUE.

After the user (keyboard and mouse) has been idle for the given time then the OnTimer event will fire.

Note: I have the impression that it was not specifically designed for this purpose, but it works.


   
ReplyQuote
Share: