Drawing strings from a menu item's keyEquivalent

  • My custom menu item view is coming along nicely, except when it comes to Unicode key equivs such as used for the Home key (north west arrow \u2196). When I ask the item for its keyEquivalent, the string has the character \uf729 instead. Inspecting the .xib I see it has the utf8 value EF 9C A9 (same as \uf729, which is in the PUA). Why is this? How can I draw the key equiv correctly? Am I going to have to find the values of all these non-Roman keys and map the value from the menu item to the actual printable glyph? This menu Cocoa menu stuff is pretty neat, but *man* is it lacking in customizability.

    There's also no NSColor method for getting disabled menu item text color, so I had to waste time trying different values until I found something that matches.

    --
    Steve Mills
    office: 952-818-3871
    home: 952-401-6255
    cell: 612-803-6157
  • On May 31, 2013, at 11:36 AM, Steve Mills wrote:

    > My custom menu item view is coming along nicely, except when it comes to Unicode key equivs such as used for the Home key (north west arrow \u2196). When I ask the item for its keyEquivalent, the string has the character \uf729 instead. Inspecting the .xib I see it has the utf8 value EF 9C A9 (same as \uf729, which is in the PUA). Why is this?

    That's the value of NSHomeFunctionKey.

    > How can I draw the key equiv correctly? Am I going to have to find the values of all these non-Roman keys and map the value from the menu item to the actual printable glyph?

    Probably.

    Regards,
    Ken
  • On 2013/06/01, at 13:08, Ken Thomases <ken...> wrote:

    > On May 31, 2013, at 11:36 AM, Steve Mills wrote:
    >
    >> My custom menu item view is coming along nicely, except when it comes to Unicode key equivs such as used for the Home key (north west arrow \u2196). When I ask the item for its keyEquivalent, the string has the character \uf729 instead. Inspecting the .xib I see it has the utf8 value EF 9C A9 (same as \uf729, which is in the PUA). Why is this?
    >
    > That's the value of NSHomeFunctionKey.
    >
    >
    >> How can I draw the key equiv correctly? Am I going to have to find the values of all these non-Roman keys and map the value from the menu item to the actual printable glyph?
    >
    > Probably.
    Definitely.
    The character pallet will help.
    You can actually put those characters in a string literal or in a strings file.
    But most keyboards don't have the glyphs for them and most people won't recognize them.
    The System Preferences keyboard shortcut settings don't even display them that way.
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today