On Sat, Jul 26, 2008 at 8:42 AM, Cloud Strife <[EMAIL PROTECTED]> wrote: > Hi everyone. Maybe this issue is very odd, but I came across it indeed. > I wrote an application using an override NSView to respond events trigged by > users. Obviously, rewrite the -(void)mouseDown:(NSEvent* )theEvent is > necessary. > I want to test what button of mouse the user presses. So I want to check the > output of the [NSEvent type] value. Surprisingly, the output value is always > 1, that is NSLeftMouseDown. No matter what button I pressed, the left button > or the right button, using a three-button mouse, cocoa kept reporting I > pressed the left button. > > I am using a mouse shipped with Mac Pro(one key only), and a mouse made by > Microsoft(three keys, I am using it for testing :-) ). It is understandable > cocoa can only detect the left key when using the one-key mouse. But it is a > little puzzled returning a left-button-down event when press the right > button. Maybe cocoa is angry with Microsoft Mouse? > > > It is really strange... Can anyone here tell me what is wrong here? Any help > is highly appreciated. > Thank you very much. Have a nice day.
Does the mouse behave properly in other applications (i.e. to show the context menu)? Does the "bad" left mouse click event have any modifiers set, such as the control key? In any case, the right mouse button shouldn't be triggering your mouseDown: method at all. There's a separate method for it, rightMouseDown:. Maybe you'll have better luck if you implement that. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]