Re: Non-character as button key equivalent
Re: Non-character as button key equivalent
- Subject: Re: Non-character as button key equivalent
- From: "Erik J. Barzeski" <email@hidden>
- Date: Thu, 25 Jul 2002 08:33:01 -0400
On 7/25/02 7:17am, Thomas Jahnsen <email@hidden> wrote:
>
I'm having two buttons with arrows in them, one to the right and one to
>
the left. Now I want the user to be able to press Cmd-Right/Left Arrow
>
to invoke these buttons (besides simply clicking them). But I am a bit
>
unsure of what to type in the IB key equivalent box, or pass to the
>
NSButton setKeyEquivalent: (which takes an NSString argument).
>
Does Cocoa support non-printing characters as key equivalent? I know
>
there is functionality for it in Carbon, there is a Menu Manager
>
function SetMenuItemKeyGlyph that can set the printed equivalent to
>
arrows.
>
And no, there are no text fields in this window that wants Cmd-Arrow to
>
modify the insertion point.
>
>
-Thomas Jahnsen
- (void)awakeFromNib
{
unichar left = NSLeftArrowFunctionKey;
unichar right = NSRightArrowFunctionKey;
[leftItem setKeyEquivalent:[NSString stringWithCharacters:&left
length:1]];
[rightItem setKeyEquivalent:[NSString stringWithCharacters:&right
length:1]];
}
--
Best wishes,
Erik J. Barzeski
"My girlfriend always laughs during sex -
no matter what she's reading." - Steve Jobs
###################################################################
Email: erik@(anything below) AIM: iacas
http://iacas.org http://weims.net
http://techstra.net http://barzeski.com
http://cocoadevcentral.com http://soundsetcentral.com
http://freshlysqueezedsoftware.com http://applescriptcentral.com
###################################################################
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.