I have a Windows vb.net project that does an occasional "auto refresh" based on a 20 minute timer. I want to avoid any type of auto-refresh... if the user has manually had any interaction with the program (mouse move, click, keystroke, anything) in the past 5 minutes.
I added a global variable "Dim g_LastActivity As Date
" so the timer can detect that 5 minute mark.
Is there some place to put my "g_LastActivity = NOW
" line that will ensure it will happen during ANY user activity? All mouse clicks, on all buttons, all mouse moves, anywhere, all keystrokes, basically EVERYTHING.
Or is there an entirely different way to do that?