CCH
12-11-2009, 08:22 AM
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?
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?