cocoabits / MASShortcut

Modern framework for managing global keyboard shortcuts compatible with Mac App Store. More details:
http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
BSD 2-Clause "Simplified" License
1.52k stars 220 forks source link

Add keyEquivalent to NSMenuItem #133

Closed corysullivan closed 5 years ago

corysullivan commented 5 years ago

I'm attempting to add a keyEquivalent to an NSMenuItem that corresponds to a particular MASShortcut. However, the only way I can get this value is through the MASShortcutView

shortcutView.shortcutValue.keyCodeStringForKeyEquivalent

is it possible to get a reference to the shortcut any other way?

zoul commented 5 years ago

I’m not sure if I follow. There’s a keyCodeStringForKeyEquivalent property on MASShortcut. What keeps you from using that, directly? I’m sorry if I’m missing the point.

corysullivan commented 5 years ago

Sure I can use it directly, but the shortcut is initiated in the preference controller, and I was hoping to access it elsewhere, but I can make it work. Thanks