Added charCode to keyPress function to solve Firefox issue