Trapping Function Keys and Alt-Key Combinations 
Author Message
 Trapping Function Keys and Alt-Key Combinations

The attached file contains a script for trapping and
discarding IE shortcut keys.

My problem is that none of the ALT-Key combinations nor
any of the Function Key activations are being discarded.  
Apparently, IE acts on them before the onkeydown event
fires on the document.

Question:  Is there a way to trap these keys and discard
them before IE acts?  Am I doing something wrong
(attaching to wrong event, etc.)?

Any help is appreciated.
Thanks, Robert Ordyniec

  KeyTrap.htc
1K Download


Tue, 19 Jul 2005 05:45:54 GMT  
 Trapping Function Keys and Alt-Key Combinations
You must cancle event so it will not bubble.

if(browser.IE) {
  eFrameWin.event.cancelBubble = true;
  eFrameWin.event.returnValue = false;
else {
  event.preventDefault();
  event.stopPropagation();

Quote:
}

Jacek

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Thu, 28 Jul 2005 21:50:50 GMT  
 Trapping Function Keys and Alt-Key Combinations

First, I appreciate your response to my question.  Please read on....

You may not have noticed this in the script I supplied, but at the end
of the function I submitted for evaluation were two lines of code that
should be evaluated if any of the preconditions were true.  They are:

                e.returnValue = false;
                e.cancelBubble = true;

e = IE Event Object

The event object is passed to the function when the onkeydown event
fires on the document.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 29 Jul 2005 23:02:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using the ALT key in a running script??

2. sendkeys of ALT+CTRL+DELETE keys

3. simulate the right shift+alt key??!!!!!!!!!

4. How to simulate ALT+SHift Keys??????????????????

5. trapping the enter key?

6. Trapping Enter Key

7. trap pf keys

8. Trap the <enter> key

9. Trapping Control Keys

10. trapping F5 key and cancelling

11. Trapping CLOSE key on onbeforeunload.

12. how d'you trap a key down?

 

 
Powered by phpBB® Forum Software