0

Right now I am trying to figure out how to tell if a user has interacted with a certain program at all (mouse clicks, mouse movement, keyboard presses, etc.). What will happen is if there is user interaction, the method would set a global variable to true. I don't have any code, since I am not sure where to go with this at the moment.

FyreeW
  • 395
  • 1
  • 5
  • 18
  • Are you using windows forms? Is this "certain program" your program, or just any program? – libertylocked Mar 11 '16 at 21:51
  • Just a small windows forms application, I want to know (while it is being used) if a user has used the keyboard or mouse at all. – FyreeW Mar 11 '16 at 21:56
  • this may be hard to implement for your first time. but give it a try http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C – M.kazem Akhgary Mar 11 '16 at 21:59
  • possible duplicate http://stackoverflow.com/questions/2063974/how-do-i-capture-the-mouse-move-event – libertylocked Mar 11 '16 at 22:00
  • @LibertyLocked I will give that one a look, did not see that come up when I was looking for a solution to this problem. – FyreeW Mar 11 '16 at 22:01
  • @M.kazemAkhgary unfortunately, don't think I can implement that. – FyreeW Mar 11 '16 at 22:01
  • there is also one for keyboard http://stackoverflow.com/questions/604410/global-keyboard-capture-in-c-sharp-application – M.kazem Akhgary Mar 11 '16 at 22:08

0 Answers0