Macbook pro keyboard fixes

Let’s face it, the keyboards on Apple laptops are less than ideal (to put it kindly). For some strange reason the Apple engineers forgot home/end keys, added an annoying ?(“command”) key that attempts to replace ctrl, and created a delete key that really only functions as a backspace.

Doubtless some will mention that these features can be accomplished with other key combinations but remembering all these strange key bindings across multiple platforms is a pain and I’m lazy. In this post I’ll document how I fixed many of the keyboard frustrations I’ve encountered on OSX Lion. The system I’m using is a MacBook Pro running OSX Lion 10.7.2. Many of these steps, however, will work on other OSX versions.

Step 1: Buy a real keyboard

Find a good keyboard (with home/end keys!) that fits your style. Is it worth dragging around a keyboard with your laptop? I say absolutely! A good keyboard is a must if you spend a lot of time on the computer and most laptop keyboards just don’t cut it. I personally recommend Das Keyboard Ultimate.

Step 2: The delete key

If you followed Step 1 then you’re done. A good keyboard has both backspace and delete (or “forward delete”) that will work correctly out of the box in OSX.

Step 3: Fix the ctrl key.

In OSX Lion many of the shortcuts that should use ctrl have been switched to use the annoyingly macish ? (“command”) key. For example, real computers use the shortcut CTRL+c to copy and CTRL+v to paste but in OSX these are ?+c and ?+v. This is the easiest fix. First open your keyboard preferences and select “modifier keys”. Modifier Keys Then switch the “Command (?) Key” option to “^Control” and the “Control (^) Key” option to “? Command. Now all the shortcuts that formerly used ? are now back to normal. This has the added benefit of annoying all your fanboy Mac friends when they try to use your computer. P.S. You can also disable the useless Caps Lock key from this screen!

Step 4: Home/End Keys

So you followed Step 1 and bought a keyboard that actually has home/end keys but when you try to use them you realize that OSX treats them like page up and page down. Fail. This fix will require a little more effort but should work for most applications (it will not work in Firefox, unfortunately). We need to modify the existing keybindings and the easiest way to do this is through a terminal. Open your favorite terminal application and change to the “Library” directory for your account. cd ~/Library/ If you don’t already have a directory called “KeyBindings” then create it using the mkdir command: mkdir KeyBindings. Then move into the KeyBindings directory and edit the DefaultKeyBinding.dict file (create it if it doesn’t already exist).

1
2
cd KeyBindings
vi DefaultKeyBindings.dict

Finally, add the following lines to this file.

1
2
3
4
5
6
{
  "\\UF729" = "moveToBeginningOfLine:";
  "\\UF72B" = "moveToEndOfLine:";
  "$\\UF729" = "moveToBeginningOfLineAndModifySelection:";
  "$\\UF72B" = "moveToEndOfLineAndModifySelection:";
}

Now open a text editor and confirm that Home and End work as expected.

Tweet

Comments:

Subscribe & Contact

Know how to listen, and you will profit even from those who talk badly.
~ Plutarch ~