Closed
Bug 1293
Opened 26 years ago
Closed 26 years ago
e.which doesn't return a value for keydown events
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: angus, Assigned: joki)
Details
Event.which should return the key that was pressed; it returns undefined. Here's
a test case:
<html>
<head>
<script>
function doit(e) {
document.getElementById("mytext").value=e.which;
}
window.onkeydown=doit;
</script>
</head>
<body>
<form>
<input type=text size=20 id="mytext">
</form>
</body>
</html>
When you press down a key, the value of that key should appear in the text
field.
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•26 years ago
|
||
Right, not hooked up yet.
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 2•26 years ago
|
||
I think this should be pretty much solved. It's not 100% compatible, though.
In 4.0 we sent the ascii value of the character as which. Now we're sending
the virtual key code. For A-Z and 0-9 these values match. For the rest theyu
pretty much don't. If we decide we need 100% compat here it might make moving
forward tougher. I'm going to mark this fixed. When we to full backwards
compat decisions and testing we create a new bug if this is insufficient.
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 3•26 years ago
|
||
Technically this works as of the 12.1.98 build on xpviewer.
Specifically, the script doesn't return an 'undefined', but returns the
keystroke and (for the most part, at least, as Tom notes) the ASCII value in the
text box.
Marking as verified. Angus, please re-open if necessary per Tom's 11.18.98
comments.
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
•