• 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: Contextual Menu doesn't respond to control+click
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contextual Menu doesn't respond to control+click


  • Subject: Re: Contextual Menu doesn't respond to control+click
  • From: "Nick Kreeger" <email@hidden>
  • Date: Mon, 28 Aug 2006 13:41:53 -0500

Since you are building your menu in |rightMouseDown:|, you will need to do
the same with |keyDown:| to trap a control-click.

Read here for more information:
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/chapter_6_section_3.html

- Nick

On 8/24/06, Brian Amerige <email@hidden> wrote:

Hi all,

I've got a contextual menu which works perfectly in my NSTableView,
with the exception of the fact that it doesn't respond to control
+clicks, but works fine with right clicks. I've got the following in
my NSTableView subclass:

- (void)rightMouseDown:(NSEvent *)theEvent
{
        NSPoint p = [super convertPoint:[theEvent locationInWindow]
fromView:nil];

        int i = [super rowAtPoint:p];

        if (i < [super numberOfRows])
                [super selectRowIndexes:[NSIndexSet indexSetWithIndex:i]
byExtendingSelection:NO];

        [NSMenu popUpContextMenu:[super menu] withEvent:theEvent
forView:self];
}

Thanks in advance!
Brian Amerige.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Contextual Menu doesn't respond to control+click
      • From: PGM <email@hidden>
References: 
 >Contextual Menu doesn't respond to control+click (From: Brian Amerige <email@hidden>)

  • Prev by Date: Re: compression of NSData... how to?
  • Next by Date: Re: I'm having trouble retaining a NSColor
  • Previous by thread: Contextual Menu doesn't respond to control+click
  • Next by thread: Re: Contextual Menu doesn't respond to control+click
  • Index(es):
    • Date
    • Thread