Open Bug 264922 Opened 15 years ago Updated 10 years ago
.button returns different values for mouseup and mousedown when right clicking on a Mac
This worksforme on Linux, so this sounds like a Mac widget code issue..
Assignee: events → sfraser
Component: DOM: Events → GFX: Mac
QA Contact: ian
This is the patch we use to fix the right mouse buttonup event. Elsewhere in nsMacEventHandler.cpp the same method is used to properly create the right mousedown event.
Status: UNCONFIRMED → NEW
Component: GFX: Mac → Widget: Mac
Ever confirmed: true
Comment on attachment 194208 [details] [diff] [review] mouseup event fix This is good, but the flow and reassignments are ugly. If it's a middle click with control down, we want NS_MOUSE_MIDDLE_BUTTON_UP, but we'll set mouseButton to two other constants first. In other cases, we [already] do all sorts of extraneous comparisons. There's not really enough context to see it here. Shane, it would help reviews along if you'd give us more (at least 8): cvs diff -u8. Let's get a new patch that leaves it initialized to left-up, then: if (aOSEvent.message == kEventMouseButtonSecondary) else if (aOSEvent.message == kEventMouseButtonTertiary) else if (aOSEvent.modifiers & controlKey) // Macs treat control-left click as context click
Attachment #194208 - Flags: review?(mark) → review-
Are we gonna need something for cocoa widgets here too?
here is a fresh patch based on comments. I've also modified the mousedown handling to match the mouseup handling, and hopefully enough context in the diff
(In reply to comment #5) > Are we gonna need something for cocoa widgets here too? Yes, I think we are.
Assignee: sfraser_bugs → joshmoz
Comment on attachment 202434 [details] [diff] [review] rework based on comments + else if (aOSEvent.modifiers & controlKey) + mouseButton = NS_MOUSE_RIGHT_BUTTON_UP; Uh-oh! I like the logic reorg, but control-leftmouseup is sadly not the same as rightmouseup. This would be tricky to get right, involving saved state and other icky things. Unless it's absolutely necessary, I'd leave control-leftmouseup alone.
Attachment #202434 - Flags: review?(mark) → review-
You need to log in before you can comment on or make changes to this bug.