How do I know what to put in DefaultKeyBinding.dict?

There is a wonderful resource on DefaultKeyBinding.dict including an example file as well as all the shortcut strings and methods you need, available at:

  • https://github.com/ttscoff/KeyBindings

There are also numerous other resources listed at the bottom of the page, including the official Apple Developer documentation:

  • https://developer.apple.com/library/mac/documentation/cocoa/conceptual/eventoverview/TextDefaultsBindings/TextDefaultsBindings.html

The accepted answer still provides good sources for key codes, however a full list of commands is now available from Apple here:

https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding


I found an application (KeyBindingsEdit) that is a nice UI for building it. If you are just looking for a good way to edit it, it could be helpful