문제

I have an NSMenu in Interface Builder that is connected to an NSTableView's menu outlet.

I want to assign Key Equivalents to the items in this menu so the user doesn't have to right click, but they don't work unless the menu is visible (defeating the point).

Is there any way to allow the key equivalent to work when the menu is not visible?

도움이 되었습니까?

해결책

You can put the menu items in both, the application's menubar and the context menu. The key equivalent will then work even without the context menu being visible.

다른 팁

Looks like the macOS 10.13 SDK (High Sierra) has a new property allowsKeyEquivalentWhenHidden on NSMenuItem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top