Sunday, July 27, 2014

Karabiner: a keymapping tool for osx

I have found a wonder tool for remapping keys on osx: Karabiner - Software for OS X

User manual: Karabiner - Software for OS X

User's keymap settings are stored in a file called private.xml, it can opened like this:

Note that there is also a "Event Viewer" in which you can look up keycodes and app identifiers in action.

After browsing through the documentation I have come up with a xml configuration specifically effective for Eclipse text editor area:

<?xml version="1.0"?>
    <name>Esc to ctrl-bracket three times in Eclipse</name>
      KeyCode::BRACKET_LEFT, ModifierFlag::CONTROL_L, KeyCode::BRACKET_LEFT, ModifierFlag::CONTROL_L, KeyCode::BRACKET_LEFT, ModifierFlag::CONTROL_L 

Since I use vim mode (vrapper plugin), I use the Esc key a lot, so I mapped Esc to its equivalent ctrl-[ repeated three times.

This is indeed a extraordinary piece of software, I will definitely learn more about it later!