how to bind keyboard shortcut to nsbutton in cocoa

非 Y 不嫁゛ 提交于 2020-05-13 06:21:11

问题


I want to know how to add keyboard shortcuts to buttons for example to press key "R" for pressing button "Reading" and key "M" for pressing button "meaning" where "Reading" and "meaning" are buttons in window.nib file


回答1:


Select the button in the NIB. Select the Attributes inspector. Put focus on the "Key equivalent" field. Type the desired keystroke.

enter image description here



来源:https://stackoverflow.com/questions/27428850/how-to-bind-keyboard-shortcut-to-nsbutton-in-cocoa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!