| Changing Key Bindings in OS X | Sunday | 2005.03.13 Computers & Technology |
This helpful chap has learned how to change some annoying key bindings and shared this knowledge through his blog. For those of you not in the know, key bindings define what a key does, functionally, when you press it. For example, you could program your 'f' key to type 'g' instead - but most people just settle for changing shortcut key combinations and function keys (like home, end, F1, etc.).
Using the codes found in this file (source):
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h
he shows us how you can create a special configuration file in your user's Library directory to change what specific keys do when you press them. Specifically, you create the following file:
~/Library/KeyBindings/DefaultKeyBinding.dict
The contents re-define any nasty key bindings that Apple stuck in OS X by default (source). My file now looks like this:
{
/* Home/End keys like normal */
"\UF729" = "moveToBeginningOfLine:"; /* home */
"\UF72B" = "moveToEndOfLine:"; /* end */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* shift + home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* shift + end */
/* Page up/down move the cursor, not just scroll */
"\UF72C" = "pageUp:";
"\UF72D" = "pageDown:";
/* cmd + L/R for prev/next word */
"@\UF702" = "moveWordLeft:";
"@\UF703" = "moveWordRight:";
}
Posted by reds at March 13, 2005 06:19 PM