I have a Samsung Galaxy S Relay with a physical keyboard; how can I remap a spare key to send Esc? I have a Samsung Galaxy S Relay running Android 4.1.2; it's an unusual phone because it slides open to reveal a built-in physical keyboard.

The keyboard has no Esc key. It'd be nice to have one, so that I could use it inside Terminal IDE and various terminal emulators and other apps. The Esc key is useful in the Vim text editor, as well as other software which has been ported from Linux to Android.

I'd like to remap one of the keyboard keys which I don't use (such as the voice-search key or the compose-new-email key) to send Escape.

My phone is running stock unrooted Android. But if you would like me to root it or to install CyanogenMod, that is fine.

I'm willing to modify any of the configuration files stored on the device. But I don't want to spend any money to buy a third-party app.

The Hacker's Keyboard is good. But, since I already have a physical keyboard, I want to use the physical keyboard. Cellphone screens aren't big screens; I don't want to spend valuable screen real estate on a virtual keyboard.

How can I remap a spare keyboard key to send Esc?
Here are some threads from the xda-developers Galaxy S Relay 4G general forum which may be helpful.


"[root]Alternative keyboard layout compilation"
"[GUIDE] How to get good Ctrl and Alt keys in SSH while keeping Fn"