-
15 Apr 2007 3:59 PM #1
Keypressed event on safari
Keypressed event on safari
Hi,
I am trying to trap the F1 key so I do this:
It works fine on firefox, but in Safari it doesn't work at all. Do I need to use a different event for Safari?Code:Ext.get(document).on("keypress", function(e) { if(e.getKey()==112) { alert('f1'); } }, this);
Thanks in advance. Scott.
-
15 Apr 2007 5:36 PM #2
Oh this is weird on Firefox 112 is being trigged when either "F1" or the letter "p" is pressed. On Safari only the "p" triggers the code.
scott.
-
15 Apr 2007 9:59 PM #3
Why would this be an Ext bug? In Safari keypress event is always messed up for special keys. We remap many to normalize them but not all (we don't touch F keys, you get what the browser reports).
On a side note, keydown is more consistent across browsers.
-
16 Apr 2007 4:27 AM #4
I just thought something crazy was going on. Btw by using keydown, the problem went away.



Reply With Quote