Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to bind keyboard shortcut to nsbutton in cocoa

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

like image 808
Alaa Ahmad M. Zakaria Avatar asked Dec 11 '14 17:12

Alaa Ahmad M. Zakaria


1 Answers

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

like image 146
Ken Thomases Avatar answered Oct 19 '22 18:10

Ken Thomases