We help IT Professionals succeed at work.
Get Started

Elegant IdleMonitor component

Mutley2003 asked
Last Modified: 2010-04-05
Context: a data entry app.. the emphasis is on speed of keyboarding. So the operator/user should not have to take his/her hands from the keyboard at all. Sometimes the operator gets "stuck" .. unsure of what to do next, or "where" he/she is. She needs a little prompt that comes up automatically (not a special keystroke) after eg 0.5 seconds of inactivity.


1. the prompt is a small form (with custom contents) that does not receive focus and disappears automatically

a) on any keystroke (directed to the calling form: no special keystroke like esc is needed to make it go away)
b)  a "significant" mousemove. Significant defined as more than xx pixels in x direction or yy pixels in y direction .. this is just to filter out noise mousemovements
c) tt milliseconds have elapsed

2. That prompt form will never be too large to fit on screen and the calling form will know its dimensions and how to position it.

3. Inactivity (which makes the form appear) is defined as

a) absence of any keystrokes for tt2 milliseconds
b) absence of "significant" mousemoves for tt2 milliseconds

4. Data entry is into a StringGrid

I need starter code for a TIdleMonitor which encapsulates all this, monitors the StringGrid,
 publishes an OnIdle(whichCell,ReasonForIdle) event which I can handle in my caller to display the PromptForm. But I also need an efficient PromptForm.Disappear method .. makes me think that the appearance and disappearance of the PromptForm should be coupled with the IdleMonitor to form a class TPromptOnIdle.

As usual, I am in a hurry.

Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE