cocoa - How to implement key equivalent for NSSearchField -
i have cocoa application building contains nssearchfield control. want enable keyboard shortcut / key equivalent when uses presses command-option-f, search field gets focus.
however, after searching, not clear me best way implement is. there not option set nssearchfield in interface builder.
is solution subclass nssearchfield , listen keydown event (and see if key equivalent pressed?)
you can add menu item key equivalent of ⌘⌥f i.e. commandoptionf. in menu's action, manually make search field first responder using
[window makefirstresponder:searchfield];
Comments
Post a Comment