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.

Comments

(Add your own)

Posted by GĂ©rard Talbot on 5 September 2005

1

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

No problem here:
http://www.w3.org/2002/09/tests/keys.html

No problem here:
http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/KeyEvent.htm

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.
http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/events.html#Events-KeyboardEvent-keyIdentifier

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.

Yes