Closed Bug 712535 Opened 14 years ago Closed 13 years ago

The Caps-lock key does not fire keyup at the correct time.

Categories

(Core :: Widget, defect)

defect
Not set
major

Tracking

()

RESOLVED WONTFIX

People

(Reporter: RobertWHurst, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20100101 Firefox/9.0 Build ID: 20111216140209 Steps to reproduce: See the following just fiddle. http://jsfiddle.net/GuJxJ/1/ I programmed a library called KeyboardJS. You can find it here => http://robertwhurst.github.com/KeyboardJS/ . I received a bug report that said my library does not register a release of the caps-lock key. I asked the user who posted the bug what browser they were using and it turned out they were using Firefox. The problem is that Firefox does not fire the correct event on toggling off the caps-lock key. I've tested this in Chrome and Safari, both of which fire a keyup event after toggling the caps-lock key. Actual results: On the first press of caps-lock the keydown event fires. On the second press of caps-lock the keydown event fires again. Expected results: On the first press of caps-lock the keydown event should fire. On the second press of caps-lock the keyup event should fire, Not keydown again.
Severity: normal → major
This is kind of a serious bug. Doesn't anyone want to look in to it?
OS: Mac OS X → All
Hardware: x86 → All
Keywords: inputmethod
Summary: The Caps-lock key does not fire a keyup event → The Caps-lock key does not fire keyup at the correct time.
Version: 9 Branch → Trunk
I just updated to the latest nightly and the key up event does fire, but not correctly. It should fire a key down on the first press but not a key up on release. On the second press it should fire a key up. Essentially the caps-lock key should toggle on and off.
You say this works in Chrome and Safari, have you also tested on Windows and/or Linux? Or just OS X? That would be helpful to know.
Component: General → DOM: Events
Product: Firefox → Core
QA Contact: general → events
Sorry I forgot to clarify that when I posted comment 2 I was on windows. I just check OS X and the keyup event still does not fire at all. As for linux I couldn't tell you, however anyone reading this can confirm the behaviour with the jsfiddle I posted. http://jsfiddle.net/GuJxJ/1/ If you would like to see how this should work try that fiddle in Chrome or Safari.
(In reply to Robert Hurst from comment #2) > I just updated to the latest nightly and the key up event does fire, but not > correctly. It should fire a key down on the first press but not a key up on > release. On the second press it should fire a key up. Essentially the > caps-lock key should toggle on and off. Whenever you press caps lock there should be keydown and keyup. If that is not the case, it could be some platform specific problem. On linux I get keydown and keyup.
Component: DOM: Events → Widget
QA Contact: events → general
(In reply to Olli Pettay [:smaug] from comment #5) > (In reply to Robert Hurst from comment #2) > > I just updated to the latest nightly and the key up event does fire, but not > > correctly. It should fire a key down on the first press but not a key up on > > release. On the second press it should fire a key up. Essentially the > > caps-lock key should toggle on and off. > > Whenever you press caps lock there should be keydown and keyup. If that is > not the case, > it could be some platform specific problem. > On linux I get keydown and keyup. In the case of the keyup not firing I believe you are correct as the event is fired on windows. This looks to be an OS X issue. That being the case the events do not fire at the correct time. If you try the fiddle I've posted in chrome you'll notice the caps-lock key toggles on and off; the first press and release yields a key down event, the second press and release yields a keyup event. Firefox does not do this. It fails to toggle caps-lock key in the same way as webkit does; The first key press fires both a keydown and keyup; pressing the key down fires the keydown event and on release the keyup event is delivered. This is correct behavior for a standard key that does not toggle, but the caps-lock does. What sound happen is the process i described above the first press and release yields a key down event, the second press and release yields a keyup event. All in all the Caps-lock key does not work properly and this is a serious issue.
(In reply to Robert Hurst from comment #6) > (In reply to Olli Pettay [:smaug] from comment #5) > > (In reply to Robert Hurst from comment #2) > > > I just updated to the latest nightly and the key up event does fire, but not > > > correctly. It should fire a key down on the first press but not a key up on > > > release. On the second press it should fire a key up. Essentially the > > > caps-lock key should toggle on and off. > > > > Whenever you press caps lock there should be keydown and keyup. If that is > > not the case, > > it could be some platform specific problem. > > On linux I get keydown and keyup. > > In the case of the keyup not firing I believe you are correct as the event > is fired on windows. This looks to be an OS X issue. That being the case the > events do not fire at the correct time. If you try the fiddle I've posted in > chrome you'll notice the caps-lock key toggles on and off; the first press > and release yields a key down event, the second press and release yields a > keyup event. > > Firefox does not do this. It fails to toggle caps-lock key in the same way > as webkit does; The first key press fires both a keydown and keyup; pressing > the key down fires the keydown event and on release the keyup event is > delivered. This is correct behavior for a standard key that does not toggle, > but the caps-lock does. What sound happen is the process i described above > the first press and release yields a key down event, the second press and > release yields a keyup event. > > All in all the Caps-lock key does not work properly and this is a serious > issue. Here is a video explanation http://www.youtube.com/watch?v=y7pLnLs3zeA
Is anyone going to look into this?
On Mac, the Cocoa event model doesn't notify physical keyup event for CapsLock key. Therefore, we don't dispatch it. > In the case of the keyup not firing I believe you are correct as the event is > fired on windows. This looks to be an OS X issue. That being the case the events > do not fire at the correct time. If you try the fiddle I've posted in chrome > you'll notice the caps-lock key toggles on and off; the first press and release > yields a key down event, the second press and release yields a keyup event. I don't think that the WebKit's behavior is correct. The keydown and keyup events indicate the changing physical key state. See the NumLock's behavior on them. We shouldn't break the consistency between it and other platforms. -> INVA
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Keywords: inputmethod
Resolution: --- → INVALID
Er, WONTFIX is better due to the limitation of Mac's event model.
Resolution: INVALID → WONTFIX
Oops, I forgot that NumLock is a Clear key on Mac. However, anyway, there are compatibility issue with other platform's CapsLock key. So, I don't think we should do the WebKit's behavior.
You need to log in before you can comment on or make changes to this bug.