-
Reading Keypresses without Events?
I am aware of being able to use the key events to find keypresses, but I'm looking for a way to read if any keys on the keyboard have been pressed at the time a function is run.
I am working on a script that is intended to check if the viewer is actively typing anything within the webpage (including iframes, which the normal key events can't reach). Even if they're not typing in a text box, such as using arrow keys to navigate around the page.
I seem to remember a method of using JavaScript to read what the last key pressed was, without needing to use events. Is this possible? If not, is there any way to get the key events to work on an iframe without having to modify the content of the page in the iframe?
Last edited by CCH; 12-11-2009 at 09:24 AM.
-
-
My only idea of how to work with this is to use events to store what/when is pushed, then keep that data somewhere (ie, a variable called "lastactivity") and then do whatever you want with it later without needing to (directly) use events.
As for an iframe, I'm really not sure what is possible there.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks