title: How to specify key bindings in a dict file inside Cocoa app bundle?
body: <p>(This is <em>not</em> a question about KVC/KVO and key-value bindings.)</p>
  
  <p>I'm writing an application with a "tools" panel. Every tool can be selected using one-letter key (like "M" - "Move tool"). Tool can be selected even when there is no main window and the tools panel is not selected (not being "key").</p>
  
  <p>Docs say that raw key events are not propagated to the app delegate and document controller (so I cannot rely on onKeyDown since it should happen in a WindowController). But "action events" (keys bound to a selector) are sent to the app, app delegate and document controller.</p>
  
  <p>I know two ways to set such global bindings: through NSMenuItem key equivalents in Interface Builder or using ~/Library/KeyBindings/DefaultKeyBinding.dict file (which specifies global bindings for all apps).</p>
  
  <p>Menu items approach is not good because I don't want to pollute my menu with commands which can be triggered from the tools panel.</p>
  
  <p>I would like to set such bindings programmatically or specify them in a bundled KeyBindings.dict like Xcode and TextMate do.</p>
  
  <p>However, I couldn't find docs or examples how to name such dict file and how to connect it to the app. Xcode uses PBKeyBinding.dict filename, TextMate uses KeyBindings.dict. There's no option for Info.plist to tell app to read the dict file.</p>
  
  <p>Does anybody know how this could be done?</p>
  
  <p>Thanks.</p>