2012-01-22, Sun

How to remap Capslock to Escape on Asus Transformer TF-101

I’ve been wanting to be able to do some VIM + terminal work on my Asus Eee Pad Transformer TF-101 especially since it’s got the keyboard dock. One of the biggest annoyances is how they’ve replaced the ESCAPE key with the android BACK key, which is a pain when you try to use VIM.

In this short guide, we will instead map the less-than-useless CAPS LOCK key to ESCAPE.

A few pre-requisites:

  • Your TF-101 needs to be rooted
  • You need to install Terminal IDE
  • So far, this has only been tested on Android 3.2.1.

Before we begin, find out what what language you’re using for your ASUS keyboard by going through Settings → Language & Input → Current input method. Among other options, mine says ASUS English (UK) Keyboard (ASUS keyboard).

This means I’ll be working with the locale code en_GB. If yours says something like ASUS English (US) Keyboard (ASUS keyboard), your locale code should be en_US. Just bear this in mind for now, we will be needing this piece of information shortly.

Fire up the Terminal IDE app. If you haven’t already, click on Install System in the app to get the terminal system set up. Next, go through the Options → ESC Key and select Left Alt key. Once that is done, proceed to select Terminal IDE. This will bring up a shell for you to work on.

We’re going to be making some changes to some system files, namely:

    /system/usr/keylayout/asusec.kl
    /system/usr/xt9/keylayout/qwerty-[locale code].kl

Before we can do that, we’ll need to get into superuser mode and remount the /system folder as read write. Type the following in the Terminal IDE console:

    su
    mount -o remount,rw /system

Next we’ll cd into the /system/usr/keylayout folder make a backup of asusec.kl and proceed to edit it. (I’m assuming you know vi. Why else would you want to remap Caps to Esc?).

    cd /system/usr/keylayout
    cp asusec.kl asusec.kl.orig
    vi asusec.kl

Look for the line that says:

    key 58    CAPS_LOCK        WAKE UNLOCK

Edit it so that it looks like this:

    key 58    ESCAPE           WAKE UNLOCK

Save and quit.

Next we’ll backup and edit the /system/usr/xt9/keylayout/qwerty-[locale code].kl

    cd /system/usr/xt9/keylayout
    cp qwerty-en_GB.kl qwerty-en_GB.kl.orig
    vi qwerty-en_GB.kl

Same deal. Look for the line with CAPS_LOCK and replace it with ESCAPE. Save and quit.

Now reboot your Transformer, and take your new CAPS LOCK turned ESCAPE key for a spin.

Original solution: http://forum.xda-developers.com/showthread.php?t=1144204

Isaac Su

---

Comment

  1. if your editing asusec.k1 WITHIN android and using vim, you will not have escape key mapped to save your edit! Use ctrl=[ instead.

    damon · Apr 26, 03:32 PM · #

Commenting is closed for this article.

---