• 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: modifier key query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: modifier key query


  • Subject: Re: modifier key query
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 31 Dec 2008 13:26:51 -0500

Ricky Sharp (email@hidden) on 2008-12-31 1:21 PM said:

>>> Is there a way to know if a modifier key (shift, ctrl, option, cmd,
>>> etc) is pressed?  Obviously, there's this:
>>> NSUInteger modifierFlags = [theEvent modifierFlags];
>>>
>>> but what if you need to know this information independent of an
>>> NSEvent?  Anyway to get it?  So far I haven't seen anything
>>> encouraging in the docs.
>>
>> There's GetCurrentKeyModifiers(), which is superbly documented in
>> CarbonEventsCore.h.  But sticking with NSEvent, if you can, if
>> probably
>> better.
>
>There's really nothing wrong with relying upon certain Carbon APIs.
>If or when Apple ever removes Carbon, I foresee APIs moving to new
>homes.

Sticking with NSEvent is better not because GetCurrentKeyModifiers() is
Carbon, but because of the nature of GetCurrentKeyModifiers().  Please
read the excellent comments in the header that I mentioned.  The OP was
vague on his goals/needs, so GetCurrentKeyModifiers() maybe appropriate.

Sean


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >modifier key query (From: "Wesley Smith" <email@hidden>)
 >Re: modifier key query (From: "Sean McBride" <email@hidden>)
 >Re: modifier key query (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: modifier key query
  • Next by Date: Re: modal sheet with validation logic
  • Previous by thread: Re: modifier key query
  • Next by thread: NSTextField super imposes the text
  • Index(es):
    • Date
    • Thread