Closed Bug 284251 Opened 20 years ago Closed 20 years ago

nsMacEventHandler sends 0 to the keypress event for some keys (e.g. space)

Categories

(Core Graveyard :: Widget: Mac, defect, P2)

PowerPC
macOS

Tracking

(Not tracked)

RESOLVED INVALID
mozilla1.8beta2

People

(Reporter: asaf, Assigned: asaf)

References

(Blocks 1 open bug)

Details

(Keywords: platform-parity)

Attachments

(1 obsolete file)

While working on some mac-menu bugs/enhancements in XP code, i found out that nsMacEventHandler sends 0 as the keycode for many keys. Apparently, this only applies to the keypress event (and not to keydoewn / keyup events).
Attached patch proposed patch (obsolete) (deleted) — Splinter Review
While this does fix this issue, I have to say, ftang's code is unreadable (the hard tabs don't help either) and proably worths rewrite. However, I don't think we should ever sent 0 as the keycode...
Attachment #175932 - Flags: superreview?(sfraser_bugs)
Attachment #175932 - Flags: review?(pinkerton)
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta2
It seems like the original change (in bug 41305) deliberately set either the charCode or the keyCode, but not both. Was there a reason for that? We should make sure we match what Windows does.
For keypress, charCode should be set for "character" keys, and keyCode should be set for all other keys. Changing this willy-nilly would break a lot of JS content out there, I suspect...
Comment on attachment 175932 [details] [diff] [review] proposed patch this one is wrong
Attachment #175932 - Attachment is obsolete: true
Attachment #175932 - Flags: superreview?(sfraser_bugs)
Attachment #175932 - Flags: review?(pinkerton)
Attachment #175932 - Flags: review-
As i understand it now, for charcaters |keycode=0; charcode=ascii value|; This works fine. -> invalid.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Depends on: 23363
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: