Convert key code into key equivalent string
问题 How can I convert a key code, such as kVK_ANSI_1 into a string that I can pass to setKeyEquivalent (so for kVK_ANSI_1 , I'd get @"1" )? And why are there two ways to specify keys anyway? It would make more sense to have just one representation. 回答1: I ended up using the following function found here. /* Returns string representation of key, if it is printable. * Ownership follows the Create Rule; that is, it is the caller's * responsibility to release the returned object. */ CFStringRef