At first sight this looked like an easy chore. In most cases the keypress or keydown event gets handled and the keyCode of the dot gets blocked. Instead the comma is added at the end of the current value of the input field. The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input.In a keypress event, the Unicode value of the key pressed is stored in either the keyCode or charCode property, never both. In the past, there was a keypress event, and also keyCode, charCode, which properties of the event object.In the past, keyboard events were sometimes used to track user input in form fields. Thats not reliable, because the input can come from various sources. An event module designed for use with keyboard input devices will be included in a later version of the DOM specification. As we all know, browser vendors start experimentingThe keypress event fires in Safari and Opera. However, onkeypress Safari gives very weird keyCodes: 63232-5, and the order Determine if a key has been pressed and store this in a variable. If no key has been pressed, the program should continue without waiting. Ch : CharacterAvailable : Boolean Ada.TextIO.GetImmediate (Ch, Available) If key was pressed Determine whether the keystroke is a number from the keypad. if (e. KeyCode < Keys.NumPad0Set the flag to true and evaluate in KeyPress event.KeyChar OnKeyPress IsInputChar KeyUp KeyDown Control Class System.