Debugging will show you the problem
console.log(this.value+String.fromCharCode(event.keyCode));
looking at the console you would see
So now look at what it is returning
console.log(this.value, event.keyCode);
So the key code is always returning zero.
What you need to do is use event.which
for firefox
console.log(this.value+String.fromCharCode(event.which || event.keyCode));