User Tools

Site Tools



KeyRemap4MacBook is an amazing tool that allows you to remap almost any key to any other. It works on any Mac computer not just MacBooks.

We initially started running KeyRemap4MacBook to put the Control key back in the corner where it belongs, instead of the Fn key. But we found some other really nice features, like hitting both Shift keys to turn on CapsLock.


hdiutil attach KeyRemap4MacBook-$KEYREMAP_VERSION.dmg
sudo installer -pkg /Volumes/KeyRemap4MacBook-$KEYREMAP_VERSION/KeyRemap4MacBook.pkg -target /
hdiutil detach /Volumes/KeyRemap4MacBook-$KEYREMAP_VERSION
rm KeyRemap4MacBook-$KEYREMAP_VERSION.dmg


To configure the key mapping, start KeyRemap4MacBook from the Applications directory.

  • Change Key
    • Change Fn Key
      • (laptop only) CHECK Fn+letter to Control_L+letter
    • Change Shift_L Key
      • CHECK Shift_R + Shift_L to CapsLock (+ Shift_L to turn CapsLock off)
    • Change Shift_R Key
      • CHECK Shift_L + Shift_R to CapsLock (+ Shift_R to turn CapsLock off)
    • For Applications
      • Enable at only Finder
        • Windows Explorer Navigation for Finder
          • CHECK Use F2 to Rename
          • CHECK Use Forward Delete as Delete Files
          • CHECK Cmd+R to Rename | Return to Open
      • Enable at only Terminal
        • CHECK Enable meta keys movement
    • Click ReloadXML button
  • Status Message
    • UNCHECK Show status message
  • MenuBar
    • UNCHECK Show icon in menu bar

Custom Bindings

To create custom bindings, you'll need to edit some XML. See the documentation for info on how to define the bindings.

  • Misc & Unintall
    • Open private.xml

Edit private.xml to add the following:

<?xml version="1.0"?>
    <name>Custom Settings</name>
      <name>Double-tap Shift to toggle CapsLock</name>
      <autogen>__DoublePressModifier__ KeyCode::SHIFT_L, KeyCode::SHIFT_L, KeyCode::CAPSLOCK</autogen>
      <autogen>__DoublePressModifier__ KeyCode::SHIFT_R, KeyCode::SHIFT_R, KeyCode::CAPSLOCK</autogen>
      <name>Shift+Fn To Paste (Command+V)</name>
      <autogen>__KeyToKey__ KeyCode::FN, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_SHIFT, KeyCode::V, ModifierFlag::COMMAND_L</autogen>
      <not>TERMINAL, ITERM</not>
      <device_only>DeviceVendor::APPLE_COMPUTER, DeviceProduct::Keyboard_with_Numeric_Keypad</device_only>
      <name>Control+Fn To Copy (Command+C)</name>
      <autogen>__KeyToKey__ KeyCode::FN, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::C, ModifierFlag::COMMAND_L</autogen>
      <not>TERMINAL, ITERM</not>
      <device_only>DeviceVendor::APPLE_COMPUTER, DeviceProduct::Keyboard_with_Numeric_Keypad</device_only>
      <name>Fn To F19 (Terminal only)</name>
      <only>TERMINAL, ITERM</only>
      <autogen>__KeyToKey__ KeyCode::FN, KeyCode::F19</autogen>
      <device_only>DeviceVendor::APPLE_COMPUTER, DeviceProduct::Keyboard_with_Numeric_Keypad</device_only>
      <name>Control+PageDown (and PageUp) To Cycle Through Tabs (Control+Tab)</name>
      <only>TERMINAL, ADIUM</only>
      <autogen>__KeyToKey__ KeyCode::PAGEDOWN, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::TAB, ModifierFlag::CONTROL_L</autogen>
      <autogen>__KeyToKey__ KeyCode::PAGEUP, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::TAB, ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L</autogen>
      <name>Control+Return To Send Email (Command+Shift+D)</name>
      <autogen>__KeyToKey__ KeyCode::RETURN, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::D, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L </autogen>
  • Change Key
    • ReloadXML
    • CHECK the new custom settings
    • ReloadXML


  • Add <appendix> sections to provide more documentation.
  • Submit some of my custom bindings via a pull request on GitHub.
  • Consider configuring via command line instead of the GUI.
  • Try some chording combos, like the ASETNIOP bindings.
    • I'd probably prefer a customized Dvorak or Colemark layout.
  • Consider making the ESC key act as Hyper (Shift+Control+Option+Command) when held with another key.
mac/keymap.txt · Last modified: 2014/05/14 23:48 by Craig Buchek