The question is how to have a C# program (running in Windows) check to see whether or not a key button has been pressed, or the mouse has been moved/clicked, within a set amount of time in the past.
One solution I found uses the "KeyPress" event, but this only works if the control (or application) has focus. I am seeking a solution that works even while the program is running in the background.
Additionally, it would be nice to have a way to exclude certain events (i.e., the key "Z") from the conditional.