![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there any way in JavaScript to determine which key has been pressed during any of the key-press, key-down, key-up events in IE6+? It appears the "which" property only works for Netscape. |
#3
| |||
| |||
|
|
My problem, as posted elsewhere, is getting Safari to behave itself. It has window.event and behaves that way. It sets e.returnValue appropriately. It still doesn't recognize "false" and let's the key pass. |
#4
| |||
| |||
|
|
"Jules" <jules9514 (AT) yahoo (DOT) com> wrote in message news:127051ac07a23678f1365bca20fde760 (AT) news (DOT) teranews.com... snip My problem, as posted elsewhere, is getting Safari to behave itself. It has window.event and behaves that way. It sets e.returnValue appropriately. It still doesn't recognize "false" and let's the key pass. Did you try the W3C DOM events - preventDefault - method, combined with checking that the event is cancelable by checking the event's W3C DOM (boolean) - cancelable - property? |
|
Also (assuming that is no-go) have you considered trying to cancel onkeydown and/or onkeyup instead of (or in addition to) onkeypress? |
#5
| |||
| |||
|
|
I did try preventDefault() -- no go. I don't know what you mean by "combined with if the event is cancelable". What would combining the two do? |
|
Also (assuming that is no-go) have you considered trying to cancel onkeydown and/or onkeyup instead of (or in addition to) onkeypress? Yea - except we have problems with onKeyDown and Netscape 7. That's why we went with onKeyPress. Canceling keystrokes is something that whole documents have been written about regarding IE and Netscape. I can't believe that I can be the only person struggling with this with Safari... |
|
Julia |

![]() |
| Thread Tools | |
| Display Modes | |
| |