简体   繁体   English

如何在cocoa中将键盘快捷键绑定到nsbutton

[英]how to bind keyboard shortcut to nsbutton in cocoa

我想知道如何向按钮添加键盘快捷键,例如按“R”键按下“阅读”按钮,按“M”键按下按钮“含义”,其中“阅读”和“含义”是window.nib中的按钮文件

Select the button in the NIB. 选择NIB中的按钮。 Select the Attributes inspector. 选择“属性”检查器。 Put focus on the "Key equivalent" field. 把重点放在“关键等效”字段上。 Type the desired keystroke. 键入所需的击键。

在此输入图像描述

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

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