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.