Closed
Bug 112379
Opened 24 years ago
Closed 24 years ago
keyCode always zero (0) for keypress events
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: bugzilla, Assigned: joki)
References
Details
Attachments
(2 files)
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6+)
Gecko/20011125
BuildID: 20011125
keyCode always return 0. which returns the correct value. But shouldn't keyCode
return the same as which?
Reproducible: Always
Steps to Reproduce:
1. run testcase
Reporter | ||
Comment 1•24 years ago
|
||
One other bad thing, is that when you press the button the document has not the
focus, the urlbar has it.
After clicking on the document it works. But then you notice that if you press
the spacebar the alert button shows for a milisecond and then it disappears!
Comment 2•24 years ago
|
||
Build ID: 2001 11 27 03. Windows 2000.
When trying the testcase, not every key results in keyCode 0.
For example, RETURN causes 13, and ESCAPE 27.
Reporter | ||
Comment 3•24 years ago
|
||
Yes, also the arrow keys return a value, but not all the keyboard. About
pressing space and the disappearing alert, maybe I should file a new bug on that?
Reporter | ||
Updated•24 years ago
|
Summary: Event.keyCode always return 0 → Event.keyCode does not always return correct value
![]() |
||
Updated•24 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 4•24 years ago
|
||
Event.which is an old property from Netscape 4.x. Mozilla uses event.keyCode
and event.charCode. These values are set differently depending on the event
although the general rule is that keypresses which generate characters use
charCode and keypresses which do not use keyCode. Event.which is set to
whichever value most closely matches the old values returned by 4.x and is not
expected to match keyCode or charCode 100% of the time.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
![]() |
||
Comment 5•23 years ago
|
||
*** Bug 140846 has been marked as a duplicate of this bug. ***
Updated•23 years ago
|
QA Contact: rakeshmishra → trix
Reporter | ||
Comment 6•20 years ago
|
||
*** Bug 318735 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Summary: Event.keyCode does not always return correct value → keyCode always zero (0) for keypress events
Comment 7•13 years ago
|
||
I see no reason why this bug was abandoned in 2001, I've just come across this issue and as far as I can tell the keydown event has not been deprecated (unable to find any reference to a list of events in DOM4).
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•