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

RESOLVED INVALID

Status

P2
major
RESOLVED INVALID
14 years ago
9 years ago

People

(Reporter: mano, Assigned: mano)

Tracking

(Blocks: 1 bug, {platform-parity})

Trunk
mozilla1.8beta2
PowerPC
Mac OS X
platform-parity
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

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).
Created attachment 175932 [details] [diff] [review]
proposed patch

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

Comment 2

14 years ago
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
Last Resolved: 14 years ago
Depends on: 23363
Resolution: --- → INVALID

Updated

13 years ago
Blocks: 280805

Updated

9 years ago
Component: Widget: Mac → Widget: Mac
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.