Re: how to save keyboard shortcuts?
Re: how to save keyboard shortcuts?
- Subject: Re: how to save keyboard shortcuts?
- From: Bob Warwick <email@hidden>
- Date: Wed, 25 Jun 2008 12:19:54 -0300
On 25-Jun-08, at 12:04 PM, HAMSoft Admin wrote:
I'm really new at this so please be kind!
I recently learned how to make menu item keyboard shortcuts for my
program. The problem is that on the next launch of the program the
shortcuts are gone, so they are not being automatically saved. Is
there a setting in IB for my menu to enable auto-saving of them or
do I have to do it manually? I'm setting them with something like
this:
[menuitem setKeyEquivalentModifierMask:NSControlKeyMask |
NSCommandKeyMask];
[menuitem setKeyEquivalent:@"U"];
If I have to do it manually I'm not sure how. First to get the
modifier keys for a particular menu item I'm using this...
int thekmm = [menuitem keyEquivalentModifierMask];
But I don't understand the returned integer. Plus do I have to
create an array of modifiers and keys for every menu item in my
program and save/restore that on every launch? Thant doesn't make
sense, so there must be an easier way.
Thanks,
Hank
Hello -
Have you considered setting your keyboard shortcuts in IB? Just
select your menu item in IB and change the "Key Equiv." from the
attributes panel.
-Bob Warwick
_______________________________________________
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