• 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: Another best practice question: storing hotkey assignments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another best practice question: storing hotkey assignments


  • Subject: Re: Another best practice question: storing hotkey assignments
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 04 Jan 2014 23:15:21 -0600

On Jan 4, 2014, at 3:58 PM, Alex Hall wrote:

> //store a keystroke
> NSUInteger key=[event keyCode]+[event modifierFlags];

This isn't safe.  The documented device-independent modifier flags are all in the high 16 bits of a 32-bit value, but there are other flags in the other bits.  At the very least, you would need to AND the modifier flags against NSDeviceIndependentModifierFlagsMask to clear the other bits.

Regards,
Ken


_______________________________________________

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: 
 >Another best practice question: storing hotkey assignments (From: Alex Hall <email@hidden>)
 >Re: Another best practice question: storing hotkey assignments (From: Steve Mills <email@hidden>)
 >Re: Another best practice question: storing hotkey assignments (From: Alex Hall <email@hidden>)

  • Prev by Date: Re: Another best practice question: storing hotkey assignments
  • Next by Date: Re: CVPixelBufferCreateWithPlanarBytes does not execute callback when released
  • Previous by thread: Re: Another best practice question: storing hotkey assignments
  • Next by thread: Auto Layout with NSSplitView, NSScrollView
  • Index(es):
    • Date
    • Thread