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
I need to know which NSString values i can use for key equivalents.
I can't find out what to use for
I wrote a program to look them up. Here's the output:
2010-08-14 06:12:24.676 KeyEquivalents[2313:a0b] Key equivalent for Return: (<0d>) 2010-08-14 06:12:24.678 KeyEquivalents[2313:a0b] Key equivalent for Enter: (<03>) 2010-08-14 06:12:24.679 KeyEquivalents[2313:a0b] Key equivalent for Backspace: (<08>) 2010-08-14 06:12:24.680 KeyEquivalents[2313:a0b] Key equivalent for Forward delete: (<7f>)
Return is carriage return, ctrl-M in the terminal world; Enter is ctrl-C in the terminal world; Backspace is the backspace character, ctrl-H in the terminal world; forward delete is the delete character.
Pretty much all the key equivalents are simply the character that you would normally enter for that. Return is a return character, backspace is a backspace character, tab is a horizontal tab character—no surprises.
The same goes for the keys on the numeric keypad, which aren't distinguished from their cousins in the main keyboard. We are dealing with characters here, after all, and both sets of keys enter the same characters. I don't think there is a way to set a menu's key code rather than its key-equivalent character; you would need to implement this yourself.
Note that “delete” (as the opposite of backspace) is called “forward delete” on the Mac, as backspace is usually called delete.