?
Solved

Idle after no keyboard/mouse movement

Posted on 2003-02-26
10
Medium Priority
?
771 Views
Last Modified: 2008-03-10
Hi there

How can i detect if a user is idle? When he/her hasn't touched the keyboard or mouse for X minutes. Like with the screensaver. I tried using a global hook, but theres so many problems to it.. biggest problems was that i received mouse movement messages when forms resized themself. Oh, and that when Delphi halted my app, windows halted too.

There must be some easier way?
0
Comment
Question by:skyfex
9 Comments
 

Author Comment

by:skyfex
ID: 8025687
I just figured i can use getcursorpos (or whatever that function is called) every 5 seconds or so to detect mouse movement, anything like that for the keyboard?
0
 

Author Comment

by:skyfex
ID: 8025810
I just figured i can use getcursorpos (or whatever that function is called) every 5 seconds or so to detect mouse movement, anything like that for the keyboard?
0
 

Author Comment

by:skyfex
ID: 8025811
I just figured i can use getcursorpos (or whatever that function is called) every 5 seconds or so to detect mouse movement, anything like that for the keyboard?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Accepted Solution

by:
gandalf_the_white earned 340 total points
ID: 8026492
what is if the user is watching a video?
you won't get any input but the user is not idle.

for hooking look at this question
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20517847.html


there you have a keyboard and a mousehook
0
 
LVL 1

Expert Comment

by:keashF
ID: 8028372
try the application's onIdle event :

 application.OnIdle := myOnIdle;

 procedure Tform1.myOnIdle(Sender: TObject; var Done: Boolean);
 begin
    ...
 end;

cu
keashF
0
 

Author Comment

by:skyfex
ID: 8032603
Uhm keashF.. The OnIdle event tells when the application is not processing anything, not when the user is idle.
0
 
LVL 1

Expert Comment

by:keashF
ID: 8033671
ah, sorry
0
 

Expert Comment

by:CleanupPing
ID: 9317062
skyfex:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9981438
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept gandalf_the_white's answer THE REFERENCED Q IS REALLY COMPLETE
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question