PDA

View Full Version : Multiple keystroke detector



fileserverdirect
11-04-2007, 03:41 PM
Hello,
I have seen on this forum MULTIPLE keystroke detectors, ie. when you press Alt + S it submits the Quick Reply message. I found a similar script on DD that only alows letter keys and only one of them. Can someone please show me a script that does this (jumps to a page or does an action, when multiple keys are pressed, one in which is not a letter)?
Thanks in advanced.
--FSD

jscheuer1
11-04-2007, 04:12 PM
See:

http://www.quirksmode.org/js/keys.html

The short answer though is that there are so many reserved key combos (and these vary from browser to browser, system to system) that this is impractical. Even with single keys, you may be grabbing half of a predefined combo and that could have odd results for the user. It's best to find another way to do whatever it is that you want to do. Some way that doesn't involve intercepting and interpreting the meaning of key press events.

Twey
11-04-2007, 05:15 PM
The "detector" used here is just the accesskey (http://www.w3.org/TR/html4/interact/forms.html#h-17.11.2) attribute, I think.