First of all, instead of two events, there is now only one, KeyPressed. This event fires after a key has been pressed and the Details parameter now includes several more pieces of information:
- 4 Booleans that indicate the state of the different meta keys — AltKey, CtrlKey, MetaKey and ShiftKey.
- Character contains the character that the user typed, assuming the key that was pressed has a glyph associated with it.
- CharCode contains the ascii character code associated with the key.
- KeyCode contains the keyboard code associated with the key (note: this may be different than CharCode, but not always). 28 KeyCode Constants to help you figure out which non-character key has been pressed.
Note: Some browsers even include the key names in the Character property. For instance, if you pressed the down arrow key, Character might be set to "Down". Don't rely on this functionality, it's not consistent from browser to browser.