用户按键/鼠标输入跟踪。 C#
我想追踪我离开键盘多久/我休息了多久。 我认为跟踪我的键盘和鼠标是了解我何时离开和到达的好方法。 跟踪这个的最好方法是什么? 我看到的一些选项
- 对于每次按下鼠标和键盘都有一个系统范围的回调。
- 休眠 100 毫秒,看看是否有按键或鼠标移动
- 使用一个系统调用来实际告诉我最后一次用户输入是什么时候,并有效地使用上述组合。 (休眠直到用户离开,然后使用回调来跟踪到达)
I want to track how long i been away from my keyboard/how long i took a break. I figure tracking my keyboard and mouse is a good way to see when i left and arrived. Whats the best way to track this? Some options i see
- Have a system wide callback for every mouse and keyboard press.
- Sleep for a 100ms and see if there is a keydown or mousemovent
- Use a system call that actually tells me when the last userinput was and use a combo of the above for efficiently. (sleep until user is away, then use callback to track arrival)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试查看此。
您不需要自己进行跟踪,看起来您可以进行系统调用来获取空闲时间。
Try looking at this.
You shouldn't need to do the tracking yourself, it looks like you can do system calls to get the idle time.
http:// www.geekpedia.com/tutorial210_Retreering-the-Operating-System-Idle-Time-Uptime-and-Last-Input-Time.html 也可能会帮助你
晚点 :P :P
http://www.geekpedia.com/tutorial210_Retrieving-the-Operating-System-Idle-Time-Uptime-and-Last-Input-Time.html might also help you
bit late :P :P