I really like the combination of the Asus Transformer, the keyboard and Connectbot. It give you a very nice terminal. However, using Unix and vi I use the escape key a lot. On the keyboard this translates to the back button, neatly exiting your current session.

But if you have root access it is quite easy to fix this. I never use the key to switch of the wifi on the transformer, so I mapped that key to the back button and the back button to escape. To do this, edit the following file on the transformer:

/system/usr/keylayout/asusec.kl

If you are editting on the Transformer itself, don’t forget to remount /system as read-write otherwise you won’t be able to save your modifications.

mount -o remount,rw /system

In the file you need to find these two lines:

key 158 BACK WAKE UNLOCK key 238 WIRELESS WAKE UNLOCK

To change their behaviour, change the lines to:

key 158 ESCAPE WAKE UNLOCK key 238 BACK WAKE UNLOCK

So, key 158 is now escape and key 238 is back. If you fancy a different mapping, that is also possible.

And don’t forget to mount /system as read-only again when you’re done editting.

mount -o remount,ro /system

Undocking and docking with the keyboard should be enough to make the changes active.