I'm working on a Status Bar App. I'd like to allow the user to modify the menu item key equivalents to their own preferences. I've seen this done before it's a pretty common feature. A prefs window usually has an area with textfields where the user enters their keyboard shortcut for specific menu items.
How does one setup the textfield so that it displays the modifier key fonts? The default NSTextfield ignores modifiers.
Also I have yet to find an example project showing this functionality, if anyone has a link that would be very helpful.
You may wish to take a look at Shortcut Recorder which allows the user to record key equivalents using modifiers and then for you to retrieve them and set them for the NSMenuItem
.
Once the user has recorder their shortcut/key combination you can access the SRRecorderControl
's objectValue
property which has values for the key code and modifier flags.