Rebinding the capslock key

Author's note: This walkthrough was originally written 11/13/2015, but vaious keyboard shortcuts have been updated since then.

Updated 9/4/2016: Including the Linux process for this.

Inspired by this reddit thread.

Why rebind my capslock key?

To give you an idea of how you would use this setup, here's the shortcuts I'm currently using.

My Shortcuts

The general idea is to not stray from the home row as much as possible. Less movement = more effiency!

Boring Disclaimer

All directions given for navigating through Seil and Karabiner are current as of the time of writing. Use these instructions at your own risk, I am not responsible for you remapping ' to ` . This tutorial works for OSX and my specific linux setup, but the same principal can be applied to other OSs.

Process

OSX

  1. Install Karabiner

  2. Intall Seil

  3. Open Seil and remap capslock

  4. add a custom private.xml file for Karabiner

And you can now use your capslock key for useful things!

Briefly, what I am doing is defining a new modifier key (like command, option, or shift) and binding capslock to that key so that we can create our own shortcuts with capslock + some key.

Linux

I did this process on my acer chromebook, which has a search key instead of a capslock key, so instructions might vary according to your device.

  1. Figure out the keycode of the search (or capslock) key

    We can use xev to do this.

    xev will show us a bunch of information about all the events happening while it is running. What's important to us is that is shows the keycodes of the keys that are pressed. Press your capslock key and make note of the keycode.

  2. Rebind search key (or capslock) to super so that we can use it as a modifier key

    You could also use hyper or meta if you already make use of a super key.

    Replace 133 with the keycode of your key if it's different.

    xmodmap -e 'keycode 133 = Super_R'
    
  3. Install autokey

    Autokey bills itself as a 'desktop automation utility'. We can use it to bind custom key combinations to our newly bound super key.

    sudo apt-get install autokey-gtk
    

    Note: if anything goes wrong with autokey, the log file is located by default in ~/.config/autokey/autokey.log

  4. Write autokey snippets

    While autokey gives you the power to write full python scripts, all we really need is to send a key or phrase when we hit a key combination. We can write what autokey calls 'phrases' to accomplish this, and bind our specific key combination to trigger them.

    For example, write a phrase like the following:

    <up>
    

    and bind it to super + w, or whatever key combination you want to trigger the up key.

    A full list of special keys that autokey supports can be found here.

  5. (Maybe) Rebind window manager keys

    This process might cause some conflicts with whatever default keybindings are setup with your window manager, so you might need to change those.