keyCodes are different from the ASCII values. For a complete keyCode reference, see http://unixpapa.com/js/key.html
For example, Numpad numbers have keyCodes 96 – 105, which corresponds to the beginning of lowercase alphabet in ASCII. This could lead to problems in validating numeric input.