- DavidJCobb
- |
- Fabled Legendary Member
Left here a long time ago.
Posted by: master of ares (post)
ill try that, thanks.
would i add another line that also listens, or edit the current line and add onkeydown to that?Depends very heavily on how they registered the event listener, and what the listener actually does.
Assuming that the listener simply sets some variable to mark the time you were last active, here are examples of how you could add it:
If they used addEventListener:
some_node.addEventListener("mousemove", theFunction, true); // original code
some_node.addEventListener("keydown", theFunction, true); // what you add
If they used jQuery bind:
//$(some_node).bind("mousemove", theFunction); // original code, delete
$(some_node).bind("mousemove keydown", theFunction); // new code
If they used jQuery event-specific functions:
//$(some_node).mousemove(theFunction); // original code, delete
$(some_node).bind("mousemove keydown", theFunction); // new code
Is the script you're editing on UserScripts.org? If so, you can PM me: remind me that I offered to help, link to the script, tell me where the code you want to change is, and I'll see if I can offer you any advice that'd be more... concrete.
[Edited on 02.10.2011 5:37 PM PST]