Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where i find a list of Key Equivalent strings on MacOSX

Tags:

macos

cocoa

I need to know which NSString values i can use for key equivalents.

I can't find out what to use for

  • cursor keys
  • delete/backspace
  • function keys
  • numpad items
like image 738
Lothar Avatar asked Aug 14 '10 12:08

Lothar


1 Answers

See Button Programming Topics: Setting a Button’s Key Equivalent:

https://developer.apple.com/library/mac/documentation/cocoa/conceptual/Button/Tasks/SettingButtonKeyEquiv.html

For a single character:

[button setKeyEquivalent:@"\r"];

For a non-print character:

unichar left = NSLeftArrowFunctionKey;
[button setKeyEquivalent:[NSString stringWithCharacters:&left length:1]];

Buttons and menu items use the same APIs for key equivalents.

like image 168
jeberle Avatar answered Oct 17 '22 03:10

jeberle