Incorrect event.key from some keypress events in Firefox #2183

Closed
gpbmike opened this Issue Dec 21, 2011 · 8 comments

Projects

None yet

5 participants

@gpbmike
gpbmike commented Dec 21, 2011

http://jsfiddle.net/PfAeW/3/

In Firefox (tested in 8.0.1) the following keys will give you an incorrect keypress event.key:

end gives you #
. gives you delete
' gives you right
( gives you down

There might be more. I didn't test the whole keyboard.

@ibolmo
Member
ibolmo commented Dec 21, 2011

Thanks. I can reproduce it on a Mac keyboard US. What's your setup?

  1. Keyboard Layout: US, EU
  2. OS?
@gpbmike
gpbmike commented Dec 21, 2011
  1. US keyboard
  2. OS X 10.7.2
@incendium

Also able to reproduce this in the Firefox (9.0) beta channel build. A lot (but not all) of the symbol keys seem to be incorrect.

  1. US Keyboard
  2. Windows 7 Professional SP1
@sebmarkbage
Member

The event.key property is only valid during keydown and keyup events.

@arian
Member
arian commented Jan 8, 2012

What Sebastian said.

keypress events should pass a charCode value, which is a char that can be transformed with String.fromCharCode to a string representation.

Also see http://www.quirksmode.org/js/keys.html

@arian arian closed this Jan 8, 2012
@ibolmo
Member
ibolmo commented Jan 8, 2012

Perhaps a documentation update?

On Sat, Jan 7, 2012 at 8:00 PM, Arian Stolwijk <
reply@reply.github.com

wrote:

What Sebastian said.

keypress events should pass a charCode value, which is a char that can
be transformed with String.fromCharCode to a string representation.

Also see http://www.quirksmode.org/js/keys.html


Reply to this email directly or view it on GitHub:
#2183 (comment)

@arian arian reopened this Jan 8, 2012
@arian
Member
arian commented Jan 8, 2012

hm, yeah, documentation could be a bit more clear about this.

@ibolmo
Member
ibolmo commented Jan 30, 2012

Fixed: bf1d54c

@ibolmo ibolmo closed this Jan 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment