• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Capturing right button mouse clicks in NSMatrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capturing right button mouse clicks in NSMatrix


  • Subject: Re: Capturing right button mouse clicks in NSMatrix
  • From: Jim Rankin <email@hidden>
  • Date: Thu, 11 Apr 2002 09:53:48 -0400

You can make a subclass of NSMatrix and override mouseDown: with
something like this:

-(void)mouseDown:(NSEvent *)event {
if ([event modifierFlags]& NSRightMouseDownMask) {
/* your custom logic here */
} else
[super mouseDown:event];
}

This should test whether the right mouse button is down in the current
event and execute your code for that case if so. Otherwise, it just
calls the regular NSMatrix mouseDown: handler.

You may also need to call super's mouseDown: after your custom logic as
well, depending on what you want to do.

Best,
Jim Rankin

WebObjects/EOF/Cocoa/AppleScript Studio developer for hire

On Wednesday, April 10, 2002, at 05:48 PM, Oscar Morales Vivs wrote:

> Which would be the best way to capture right button mouse clicks in a
> NSMatrix the same way the left mouse clicks are captured?
>
> It seems all the classes (NSCell, NSMatrix, NSButtonCell...) are set
> for capturing left button clicks, and at most displaying a menu with
> the right button.
>
> Thanks in advance for your help.
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Capturing right button mouse clicks in NSMatrix (From: Oscar Morales Vivó <email@hidden>)

  • Prev by Date: Re: Preference Pane and CFPreferences
  • Next by Date: Re: Open Resource File with Cocoa Path
  • Previous by thread: Capturing right button mouse clicks in NSMatrix
  • Next by thread: ScreenSaver & Bundles
  • Index(es):
    • Date
    • Thread