Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arrow keyEquivalent in InterfaceBuilder



on 2004-12-31 4:15 PM, Lorenzo at email@hidden wrote:

> in InterfaceBuilder, open the menu object, then just double click on the
> "Key-Equivalent" field in the "menu item" line (not in the inspector), then
> when ready hit the arrow key on your keyboard. You will see the arrow symbol
> in the "Key-Equivalent" field. Now, in the Inspector panel, you can even add
> modifier keys like Comman, Option, or Control key.

<Sigh> I wasted so much time doing this in code. I suppose this is
documented somewhere, and I just never noticed it?

Will the nib file work when you run the app under Mac OS X 10.2 Jaguar?

A code way to do this is to put a few lines of code in -awakeFromNib, like
this:

unichar rightwardsArrow = 0x2192;
[[self myMenuItem] setKeyEquivalent:[NSString
stringWithCharacters:&rightwardsArrow length:1]];
[[self myMenuItem] setKeyEquivalentModifierMask:0]; // Command key


--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Arrow keyEquivalent in InterfaceBuilder (From: Lorenzo <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.