Invalid keyCode given on a keyboard event

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:

Search reports by browser:

Keyboard events for non-alphanumeric keys create an incorrect keyCode attribute on the event. This appears to be a problem on all browsers but Opera 8b and higher.

The workaround is very much a hack and does not work for international users.

Test page Workaround is included
Reported by: Peter Siewert.

(Orphaned), Explorer 5-6 Windows, Explorer Mac, Mozilla, Safari | Reported on 31 January 2005.


(Add your own)

Posted by GĂ©rard Talbot on 5 September 2005


To see/render the character, one must query the charCode at keypress event for Mozilla and Firefox and Mozilla-based browsers.

No problem here:

No problem here:

I am sure this bug is INVALID.

P.S.: DOM 3 events propose to ditch charCode and keyCode and to implement instead keyIdentifier event property.

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.