How to create a keybinding using the [fn] key as a modifier

keyboard

The half-size arrow keys on my MacBook are a little small for me. The keys I'd prefer to use are:

  • fn +  J  to move left
  • fn +  K  to move down
  • fn +  L  to move right
  • fn +  I  to move up

I badly want to use the "fn" key for this, both for ergonomic and practical reasons (ie: avoid conflicts with other apps).

Is this possible? How?

Best Answer

I installed a third party utility to remap these keys on my MacBook Pro running OS X 10.8. Here are the steps I used:

(1) Download and install KeyRemap4MacBook.app

(2) Edit (or create) the following file in a text editor:

~/Library/Application Support/KeyRemap4MacBook/private.xml

...so that its content is:

<?xml version="1.0"?>
<root>
<item>
        <name>JKLI to Arrow Keys</name>
        <identifier>private.jkli_to_arrow_keys</identifier>
        <autogen>
            __KeyToKey__
            KeyCode::J, ModifierFlag::FN,
            KeyCode::CURSOR_LEFT
        </autogen>
        <autogen>
        __KeyToKey__
            KeyCode::K, ModifierFlag::FN,
            KeyCode::CURSOR_DOWN
        </autogen>
        <autogen>
        __KeyToKey__
            KeyCode::L, ModifierFlag::FN,
            KeyCode::CURSOR_RIGHT
        </autogen>
        <autogen>
        __KeyToKey__
            KeyCode::I, ModifierFlag::FN,
            KeyCode::CURSOR_UP
        </autogen>
</item>
</root>

(3) Select "Preferences" from the little KeyRemap4MacBook icon in the OS X MenuBar at the top of the screen.

KeyRemap4MacBook > Preferences

(4) In KeyRemap4MacBook's "Change Key" tab, tick "JKLI to Arrow Keys". (if this option doesn't appear, you may need to click the "ReloadXML" button)

KeyRemap4MacBook > Change Key

You should now be able to use the Function key with J|K|L|I to control the cursor, in addition to the Arrow keys.