Re: Another best practice question: storing hotkey assignments
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