Skip to content
This repository

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

gpbmike opened this Issue December 21, 2011 · 8 comments

5 participants

Mike Horn Arian Stolwijk Olmo Maldonado Matthew Gast Sebastian Markbåge
Mike Horn

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.

Olmo Maldonado

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

  1. Keyboard Layout: US, EU
  2. OS?
Mike Horn
  1. US keyboard
  2. OS X 10.7.2
Matthew Gast

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
Sebastian Markbåge

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

Arian Stolwijk

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

Arian Stolwijk arian closed this January 07, 2012
Olmo Maldonado
Arian Stolwijk arian reopened this January 08, 2012
Arian Stolwijk

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

Olmo Maldonado

Fixed: bf1d54c

Olmo Maldonado ibolmo closed this January 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.