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

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -