[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cursor KeyEquivalent

From: Andreas Höschler
Subject: Re: Cursor KeyEquivalent
Date: Thu, 8 Feb 2007 18:16:12 +0100

Hi Fred,

I am creating menu items with

- (id)initWithTitle:(NSString *)aString action:(SEL)aSelector
keyEquivalent:(NSString *)charCode;

and would like this menu item to fire its action when the user presses
Command-CursorRight. What charCode string would I have to pass for this?
I have really no idea!

The file NSEvent.h has
  NSRightArrowFunctionKey = 0xF703,
but I am not sure if this value as the first character of an Unicode
string will actually work. Give it a try and report back to the list.

Here some simple untested example code:
unichar c = NSRightArrowFunctionKey;
NSString *s = [NSString stringWithCharacters: &c length: 1];

[mi setKeyEquivalent: s]

Yes, this worked indedd, except that [] is displayed in the menu item which looks somehow ugly. A better default for non-printable shortcuts would be IMHO to show nothing. Or does anybody have an idea where we could find a glyph for cursor right? Apple is showing a little right arrow in their Preview.app!?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]