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.
KEYREMAP_VERSION=8.4.0 curl -O https://pqrs.org/macosx/keyremap4macbook/files/KeyRemap4MacBook-$KEYREMAP_VERSION.dmg 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.
To create custom bindings, you'll need to edit some XML. See the documentation for info on how to define the bindings.
Edit private.xml
to add the following:
<?xml version="1.0"?> <root> <item> <name>Custom Settings</name> <item> <name>Double-tap Shift to toggle CapsLock</name> <identifier>remap.double_tap_shift_to_toggle_capslock</identifier> <autogen>__DoublePressModifier__ KeyCode::SHIFT_L, KeyCode::SHIFT_L, KeyCode::CAPSLOCK</autogen> <autogen>__DoublePressModifier__ KeyCode::SHIFT_R, KeyCode::SHIFT_R, KeyCode::CAPSLOCK</autogen> </item> <item> <name>Shift+Fn To Paste (Command+V)</name> <identifier>remap.shift_fn_to_paste</identifier> <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> </item> <item> <name>Control+Fn To Copy (Command+C)</name> <identifier>remap.control_fn_to_copy</identifier> <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> </item> <item> <name>Fn To F19 (Terminal only)</name> <identifier>remap.fn_to_insert_in_terminal</identifier> <only>TERMINAL, ITERM</only> <autogen>__KeyToKey__ KeyCode::FN, KeyCode::F19</autogen> <device_only>DeviceVendor::APPLE_COMPUTER, DeviceProduct::Keyboard_with_Numeric_Keypad</device_only> </item> <item> <name>Control+PageDown (and PageUp) To Cycle Through Tabs (Control+Tab)</name> <identifier>remap.control_page_down_to_cycle_through_tabs</identifier> <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> </item> <item> <name>Control+Return To Send Email (Command+Shift+D)</name> <identifier>remap.control_return_to_send_email</identifier> <autogen>__KeyToKey__ KeyCode::RETURN, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::D, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L </autogen> <only>MAIL</only> </item> </item> <appdef> <appname>ADIUM</appname> <equal>com.adiumX.adiumX</equal> </appdef> <appdef> <appname>MAIL</appname> <equal>com.apple.mail</equal> </appdef> <appdef> <appname>ITERM</appname> <equal>com.googlecode.iterm2</equal> </appdef> <appdef> <appname>SUBLIME_TEXT</appname> <equal>com.sublimetext.2</equal> <equal>com.sublimetext.3</equal> </appdef> <deviceproductdef> <productid>0x024f</productid> <productname>Keyboard_with_Numeric_Keypad</productname> </deviceproductdef> <deviceproductdef> <productid>0x0262</productid> <productname>Internal_Keyboard_MacBook_Pro_Retina_Mid_2012</productname> </deviceproductdef> </root>