简体   繁体   English

为NSToolbarItem分配密钥等价物?

[英]Assigning key-equivalent to NSToolbarItem?

如何设置NSToolbarItem的等效键?

You don't—toolbar items don't have keyboard shortcuts. 你没有 - 工具栏项目没有键盘快捷键。 You need a menu item that does the same thing with the right shortcut. 您需要一个菜单​​项,使用正确的快捷方式执行相同的操作。

All toolbar items should have a corresponding menu item anyway according to Apple : 根据Apple,所有工具栏项目都应该有相应的菜单项:

A toolbar is useful for giving users immediate access to the most frequently used features in an application. 工具栏可用于让用户立即访问应用程序中最常用的功能。 Any item in a toolbar should also be available as a menu command. 工具栏中的任何项目也应该可用作菜单命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM