tags:

views:

46

answers:

1
$('input').keypress(function(e){
        var k = e.keyCode ? e.keyCode : e.which;                                     
        console.log(k);     
});
<input type="text" name=""  autocomplete="off"/>

In FF for '.' (point) and for 'delete' it is the same code 46. AND for 'right' (right arrow) and for ' it is the same code 39. just to be 'safe' Chrome and IE7 don't fire nothing for keys like arrows, delete, insert, backspace etc

+1  A: 

Not really a bug per-say, just one of the many browser differences. If you look on your number-pad, they are the same key, their mapping points to that key.

Nick Craver
this was my first guess for . and delete, but is it also a good explanation for ' and right arrow ?
@silversky: Yes, same reason...it's just some of the ways browsers differ that makes development a PITA sometimes.
Nick Craver
then i'm stuck, because kwyup also doesn't work weel with delete or arrows. If you watch carefully you will see that in FF keyup don't fire nothing at first strike but on the second one, it fires twice.
@silversky: Look here, it may save you a lot of guess-work: http://www.quirksmode.org/js/keys.html
Nick Craver
thank you, now I understand. it's not a bug because there is no regulation. Every browser it has it's own rules. And some times it happens to coinside (to be the same)
@silversky: Yep...sorry the answer sucks, but it's one of the (luckily) relatively few things left that's still **VERY** different between browsers.
Nick Craver