October 19 2010
Cocoa Tip: Hot Keys without Key Equivalents
Ever wonder why Command-A on the Mac doesn’t always select all of the text? The keystroke is actually a hot key for the “Select All” menu item under Edit for Mac applications. Interface Builder presets the menu item’s key equivalent to Command-A. If the menu item isn’t there, Command-A isn’t hooked up.
Certain applications, like Google Notifier and Remind Me Later, don’t have an Edit menu, but we only need a bit of code to create a hot key like Command-A for “Select All”. (Ironically, I found an example of this code in Google Breakpad, but Google Notifier doesn’t use it.)