Detecting user idle from computer

落爺英雄遲暮 提交于 2020-01-02 07:08:18

问题


Solution found thanks to @Trinh Hoang Nhu:

Credits to @stacker ( Java Keyboard/Mouse activity (even outside of my app) ) http://ksquared.de/blog/2011/07/java-global-system-hook/

Is there any way to detect keystrokes and/or mouse acitivity from javascript even if page is not active? I'd like to just detect if user is idle or not. I'm sure it is not possible in pure javascript, baut mybe some flash applications can do it and iteract with javascript?

Browser addon is also an option. Can browser(firefox) addon monitor keyboard and mouse when inactive?

Also i have no exprience with adobe air, maybe this could be also an option?

NOTE! I want to detect all activity, enev if my page in in backround. Ex: If user is writing it notepad(not in my page), id'd like still know that user is active..

Thanks in advance!


回答1:


From comments: Sure, java applet can interact with JS. Java applet have more power than Flash and it may handle thing like your request – Trinh Hoang Nhu

Eventallly found this: ksquared.de/blog/2011/07/java-global-system-hook




回答2:


yes your can detect keystrokes and/or mouse activity from JavaScript try to look at this post may be this will help you

How can I detect with JavaScript/jQuery if the user is currently active on the page?



来源:https://stackoverflow.com/questions/11291040/detecting-user-idle-from-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!