charCode should has been used to get the key code

keyCode is not defined in Firefox.