Open
Description
There are some inconsistencies between getEventKey
and the DOM3 keyboard event spec (as well as what Firefox has implemented):
key
property is not correctly set for printable characters onkeydown
andkeyup
events. This works properly in Firefox, and my interpretation of the standard is that Firefox's behaviour is correct here. From the spec: If the key generates a printable character, and there exists an appropriate Unicode code point, then the KeyboardEvent.key attribute must be a string consisting of the char value of that character.- Enter key only fires keydown in Firefox, but fires both keydown and keypress in Chrome. This should be consistent across browsers
- CapsLock key only fires keydown when it is toggled on. When caps lock is toggled from on to off, no keydown event is fired (this may be a browser limitation in Chrome)
Repro: Test this page in Firefox and compare the result to Chrome: http://jsfiddle.net/63ycmLhe/1/