Link to home
Create AccountLog in
Avatar of jasonbb
jasonbbFlag for Australia

asked on

Detect no user input

Dear Gurus,
I want to detect when there has been no user input (mouse or keyboard) for a certain amount of time, even if my VB app is not the active app.
Like how windows activates a screen saver.
Thankyou.
Avatar of NARoberts
NARoberts

You could use a timer that checks a variable to see if its on or off.  Then use keypress to reset the variable to off or on or whatever on any keypress.  Then setup a hold area for your mouse x,y coords.  On the timer expire check current mouse x,y against the held ones. At least conceptually.   Not sure about all the code but is should be fairly easy.  
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I would prefer the above mentioned by Idle_Mind, however there is another way but you should only use it as long as its for personal use and not for deployment.
You can find my example here:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64388&lngWId=1