KeyCode and charCode

Jump to: navigation, search

WebAppsDOM3Events ⇨ keyCode and charCode

Both keyCode and charCode are commonly used, but differ wildly by platform and even implementation. It's not clear that a consistent model can be made, much less an internationalizable one. This is why Key Identifiers and textInput events were created. However, it's been suggested that there is value in specifying them anyway.


A non-normative table should be made, which combines the Key Identifiers, textInput, keyCode, and charCode values.

Data on keyCode

Internet Explorer specific, may be copied by Safari.

Results obtained from Key and Character Codes vs. Event Types:

See also the Key event monitor by Richard Ishida.

Testing Frameworks