Last Comment Bug 602812 - Inconsistency whether keypress event is dispatched or not of CapsLock, NumLock and ScrollLock keys
: Inconsistency whether keypress event is dispatched or not of CapsLock, NumLoc...
: dev-doc-needed
Product: Core
Classification: Components
Component: DOM: Events (show other bugs)
: Trunk
: All All
-- normal (vote)
: ---
Assigned To: Masayuki Nakano [:masayuki]
: Andrew Overholt [:overholt]
Depends on:
Blocks: 577630
  Show dependency treegraph
Reported: 2010-10-08 01:55 PDT by Masayuki Nakano [:masayuki]
Modified: 2016-08-18 18:15 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Masayuki Nakano [:masayuki] 2010-10-08 01:55:06 PDT
When I write a document (, I found an inconsistency issue across platforms.

On Windows, CapsLock, NumLock and ScrollLock don't dispatch keypress event.

On Linux, CapsLock, NumLock and ScrollLock dispatch keypress event.

On Mac, CapsLock dispatches only keydown event, NumLock key (without Fn key, i.e., external keyboard's NumLock key) dispatches keydown, keypress and keyup events. NumLock key with Fn key and ScrollLock key don't dispatch any key events.

The CapsLock of Mac doesn't send keyup event is a limitation of platform. I'm not sure the ScrollLock on Mac. But that isn't a matter of this bug.

The main issue of this bug is whether we should dispatch keypress event for these keys or not.

The keys don't generate any characters, so, we shouldn't dispatch keypress event at that time.
Comment 1 User image Masayuki Nakano [:masayuki] 2012-08-29 02:27:54 PDT
Note that NumLock key has been obsoleted on Mac. Please ignore the NumLock issue on Mac mentioned in the comment 0.
Comment 2 User image Masayuki Nakano [:masayuki] 2013-07-23 11:04:32 PDT
This was completely fixed by other bugs.
Comment 3 User image Eric Shepherd [:sheppy] 2016-08-18 12:12:19 PDT
Do we know when this was fixed? The documentation hasn't been updated for that fix yet.
Comment 4 User image Masayuki Nakano [:masayuki] 2016-08-18 18:15:21 PDT
I don't remember the actual bug#, however, currently, this is guaranteed by TextEventDispatcher class which is an XP level class to dispatch KeyboardEvent and CompositionEvent in same rules (unfortunately, Android widget still doesn't use it, bug 1137567). See also bug 1137560.

# Before that, I fixed each platform's widget's behavior, though.

Currently, neither modifier keys nor dead keys cause keypress event(s).

Note You need to log in before you can comment on or make changes to this bug.