• 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: Keyboard modifiers on buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard modifiers on buttons


  • Subject: Re: Keyboard modifiers on buttons
  • From: Eric Brunstad <email@hidden>
  • Date: Mon, 13 Jun 2005 11:21:36 -0400


On Jun 13, 2005, at 9:08 AM, Theodore H. Smith wrote:

I'm trying to make one button of mine work differently, if a keyboard modifier is selected. Kind of like "expand", and "expand all", where you would hold the option key to get the expand all.

How can I trap for keyboard modifiers in Cocoa from a button code? Must I go via Carbon instead?

Don't go to Carbon!  For example, this would check if the control key is pressed:

- (void)mouseDown:(NSEvent *)theEvent
{
    if([theEvent modifierFlags] & NSControlKeyMask)
    {
        // control key pressed;
    }
}

-Eric
 _______________________________________________
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

References: 
 >Keyboard modifiers on buttons (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Multiplying Tracking Rectangle
  • Next by Date: Re: Warning: critical Core Data documentation flaw
  • Previous by thread: Re: Keyboard modifiers on buttons
  • Next by thread: Multiplying Tracking Rectangle
  • Index(es):
    • Date
    • Thread