Closed Bug 602812 Opened 14 years ago Closed 11 years ago

Inconsistency whether keypress event is dispatched or not of CapsLock, NumLock and ScrollLock keys


(Core :: DOM: Events, defect)

Not set





(Reporter: masayuki, Assigned: masayuki)


(Blocks 1 open bug)


(Keywords: dev-doc-needed)

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.
Note that NumLock key has been obsoleted on Mac. Please ignore the NumLock issue on Mac mentioned in the comment 0.
This was completely fixed by other bugs.
Closed: 11 years ago
Resolution: --- → FIXED
Do we know when this was fixed? The documentation hasn't been updated for that fix yet.
Keywords: dev-doc-needed
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).
You need to log in before you can comment on or make changes to this bug.