In the following text fields, type whatever you like and notice the different behaviors in the table below it.
Here are some key observations regarding keypress events:
- Firefox sends regular keys as charCodes and special keys as keyCodes
- Safari sends both charCode and keyCode for regular keys but does not issue keypress events for special keys
- Internet Explorer does not send charCodes, only keyCodes, and does not issue keypress events for special keys
- Opera does not send charCodes, only keyCodes, but also issues keypress events for special keys making it impossible to distinguish between some keys such as '-' vs.
Insertand '.' vs.
- Konqueror will send both charCode and keyCode for regular keys, but only keyCode for special keys