$('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