Hello!
I want to create a function in my software that, before doing something, verifies if there is somebody using the PC. I imagine that the best way to do that is implement an algorithm that verifies if the keyboard or the mouse has been used in the past X seconds (I guess 10 seconds is already enough). If not, than it moves on, but if yes, than it waits. [as an analogy, the idea is to implement the same thing Windows has to verifiy if it should start the screen protection or diactivate graphics).
I guess:
What I would have to do is to connect the MouseMove Event and some sort of Keyboard Press Event to a variable that stores the current time when the event happens. When the time comes, this variable will be read and if there is X or more time elapsed since the last mouse or keyboard was touched, the software goes on.
The problem is that this MouseMove catcher and keyboard press catcher must be on even when the software is not focused (i.e. when it's not been selected, viewed, used, etc., i.e. runnning in background). Now how can I do that?
So, summarizing:
* How to make mouse move events and keyboard press events be captured even when the software runs in background?
* Which are the methods that should be used to capture the Keyboard inputs?
Thanks,
Momergil




Reply With Quote


Bookmarks