Detecting User Activity

前端 未结 2 567
悲哀的现实
悲哀的现实 2020-12-09 05:56

I need to create a program that monitors a computer for activity. Such as a mouse move, mouse click or keyboard input. I don\'t need to record what has happened just that th

2条回答
  •  生来不讨喜
    2020-12-09 06:34

    You need to set a global keyboard hook and a global mouse hook. This will result in all keyboard and mouse activity being passed to your application. You can remember the time of the last such event, and check periodically if more than your example 15 minutes have passed since that time.

    Take a look here for an example project. You may also find this useful.

提交回复
热议问题