How to associate a keyboard shortcut with nsbutton in cocoa

I want to know how to add keyboard shortcuts to buttons, for example, to press the R key to press the Read button and the M key to press the value button, where the Read and value are buttons in the File window .nib

+4
source share
1 answer

Select the button in the NIB. Select an attribute inspector. Focus on the Key Equivalents field. Enter the desired keystroke.

enter image description here

+7
source

All Articles