• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Re-Map a key on the keyboard?

Zoandroid

Android Expert
I would LOVE to somehow either disable or remap the QWERTY keyboard's "HOME" key!! My large thumbs keep wandering onto it when I am using the backspace key, and when in an email program, it 'saves as draft' and closes the program back to the desktop. Then I have to re-open the email app, sift through the folder list to find the drafts, and reopen the email just to continue typing. If I can't disable it, then setting it to be a space bar or something would at least stop it from closing the email app when I bump it.

Does anyone know of a way to do this (short of employing tools and a soldering iron)? :D
 

At first glance, this app seems like EXACTLY the solution I need. Too bad it doesn't actually WORK on the Ally. :(

I am able to make the app show that I have re-mapped the Home button to the D-Pad-Right key. Which is ideal, because when typing that doesn't do anything. :) However, after the requisite reboot the Home key still goes "home". They don't mention whether it is the Home key on the keyboard, or on the face of the phone, so I tried both, but neither of them actually gets re-mapped.

Plus, after supposedly re-mapping the key, there is a dialogue that comes up and says "(HOT) Reboot for changes to take effect" and has an OK button (which suggests IT will reboot the phone). That does not work. I had to manually reboot.

Now, when you leave on the option to reset the key assignments on reboot, and you select that in the notifications, and tell it to restore the keys, THAT does reboot the phone. So the app 'can' reboot the phone, it just isn't working correctly after a key assignment, as it does not reboot the phone when it needs to. This may be why the key assignment did not work for me on the LG Ally.

I sure appreciate the suggestion, though. If it actually worked it WOULD be the solution I have been looking for.

Thanks.
 
I just learned from a post on another forum how to manually remap the keyboard of the Ally. If you are rooted, it can be done by simply editing a text file - all you need is something like Root Explorer to access the root files on the Ally.

If anyone is interested, reply here and I'll post the instructions I wrote up telling how I did it. My qwerty keyboard's HOME key is now a harmless spacebar, and will never dump me from another email while backspacing to fix a typo. :)
 
I just learned from a post on another forum how to manually remap the keyboard of the Ally. If you are rooted, it can be done by simply editing a text file - all you need is something like Root Explorer to access the root files on the Ally.

If anyone is interested, reply here and I'll post the instructions I wrote up telling how I did it. My qwerty keyboard's HOME key is now a harmless spacebar, and will never dump me from another email while backspacing to fix a typo. :)


This is all well and good, but what if you get into a situation like on trident's 2.2.1 root guide where you need the key to have the correct mapping in order to reach a screen that is otherwise unreachable? Not bashing or anything, I think this is pretty great. I'm just trying to think of all possible outcomes.
 
It would be a simple matter to go back to the file and change it back to stock. In fact, when you edit the file using the "open with text editor" option, saving your changes creates a backup of the original file automatically. So having changed it, one would just need to remember to change it back before attempting something like running a root guide or whatever which might require the remapped key.

I think the only danger in doing this is to be very careful you do not remap something else unintentionally. But as long as you can boot and run something like Root Explorer you should be able to change it back easily enough. :)

Question - can using adb access all the system files in the Ally? If so, it could also be done that way as well.
 
Question - can using adb access all the system files in the Ally? If so, it could also be done that way as well.

Post the instructions! Seems nifty. And yeah you could backup the file and regardless of what you changed worst case you could use adb to pull and edit or just replace the file.
 
Ask and ye shall receive! :D

I am not responsible for any thing bad happening if you do this. You are editing the system files on your Ally. If you screw it up, it's your bad.

Please read this through before trying this procedure.

Note that my Ally is rooted Froyo 2.2.1 running Velocity 1.0 custom ROM. So I can't guarantee this will work if your Ally is differently configured.

1- Your Ally must be rooted.

You are looking for the /system/usr/keylayout directory, which is accessible with a utility such as Root Explorer.

For detailed information about the file(s) you will edit, you can read this:

Keymaps and Keyboard Input | Android Open Source

On that page, they explain that the /system/usr/keylayout/qwerty.kl file is the default keyboard layout file unless another is specified. When I edited key 102 in that file, which is the ONLY key listed as "Home", it did not change anything when I put in "SPACE".

(This might be due to running Velocity instead of the stock ROM, but that is just a guess. If anyone knows if Velocity (or even Froyo) changes which file is used to assign the keys, I would like to know.)

But there are additional files in this same folder. They are:

7k_handset.kl (has a few listings for headset usage)

aloha_keypad.kl (This is the one that finally worked for me. See below)

AVRCP.kl (Has listings all related to playing media)

qwerty.kl (this is the one mentioned in the above link)

When editing qwerty.kl didn't work, I tried editing aloha_keypad.kl

In that file there are 2 listings for a HOME key:

key 102 HOME WAKE_DROPPED
key 243 HOME

Key 102 is the Home Key on the qwerty keypad. Key 243 is the Home key on the face of the phone. Changing either one to replace HOME with "SPACE" makes the key be the same as the spacebar.

So setting:

key 102 SPACE

FINALLY ends my frustration with hitting the keyboard Home key by mistake when backspacing to fix typos in emails and forum posts. :D

REBOOT THE ALLY AFTER MAKING THIS CHANGE AND SAVING THE FILE

If you use Root Explorer's "open in text editor" to do the editing, once you Save the edited file Root Explorer will automatically save a backup copy of the original file for you. If not, I suggest you manually make a backup copy before you edit the file, just in case. ;)

I learned about this on the XDA Dev. forum, so many thanks to those guys!! Their actual suggestion in the posting I read said to change the "HOME" key to "FOCUS", but they were dealing with other types of phones besides the Ally. I did not see any listings for FOCUS (presumably a camera control) in the above files on my Ally so I decided to stick with something I knew the Ally keyboard used.

EDIT - After applying the Velocity 1.1 update in May 2011, the Home key on the keyboard is once again working (unfortunately). I'll need to do the above procedure again to disable it.
 
Ask and ye shall receive! :D

I am not responsible for any thing bad happening if you do this. You are editing the system files on your Ally. If you screw it up, it's your bad.

Please read this through before trying this procedure.

Note that my Ally is rooted Froyo 2.2.1 running Velocity 1.0 custom ROM. So I can't guarantee this will work if your Ally is differently configured.

1- Your Ally must be rooted.

You are looking for the /system/usr/keylayout directory, which is accessible with a utility such as Root Explorer.

For detailed information about the file(s) you will edit, you can read this:

Keymaps and Keyboard Input | Android Open Source

On that page, they explain that the /system/usr/keylayout/qwerty.kl file is the default keyboard layout file unless another is specified. When I edited key 102 in that file, which is the ONLY key listed as "Home", it did not change anything when I put in "SPACE".

(This might be due to running Velocity insterad of the stock ROM, but that is just a guess. If anyone knows if Velocity (or even Froyo) changes which file is used to assign the keys, I would like to know.)

But there are additional files in this same folder. They are:

7k_handset.kl (has a few listings for headset usage)

aloha_keypad.kl (This is the one that finally worked for me. See below)

AVRCP.kl (Has listings all related to playing media)

qwerty.kl (this is the one mentioned in the above link)

When editing qwerty.kl didn't work, I tried editing aloha_keypad.kl

In that file there are 2 listings for a HOME key:

key 102 HOME WAKE_DROPPED
key 243 HOME

Key 102 is the Home Key on the qwerty keypad. Key 243 is the Home key on the face of the phone. Changing either one to replace HOME with "SPACE" makes the key be the same as the spacebar.

So setting:

key 102 SPACE

FINALLY ends my frustration with hitting the keyboard Home key by mistake when backspacing to fix typos in emails and forum posts. :D

REBOOT THE ALLY AFTER MAKING THIS CHANGE AND SAVING THE FILE

If you use Root Explorer's "open in text editor" to do the editing, once you Save the edited file Root Explorer will automatically save a backup copy of the original file for you. If not, I suggest you manually make a backup copy before you edit the file, just in case. ;)

I learned about this on the XDA Dev. forum, so many thanks to those guys!! Their actual suggestion in the posting I read said to change the "HOME" key to "FOCUS", but they were dealing with other types of phones besides the Ally. I did not see any listings for FOCUS (presumably a camera control) in the above files on my Ally so I decided to stick with something I knew the Ally keyboard used.


Thank you! I will be giving this a try in about an hour when im out of this class.
 
You are welcome! Let me know how it goes. I am curious why there were 2 files with keyboard assignments, so maybe someone can shed some light on that.
 
does anybody know if you can set the camera button to open something other than the default camera app??? i dont know if this would be a matter of remapping it this way as ive been reading and it doesnt look like this would work. or if id have to change it somewhere else. i just want my camera button to launch vignette
 
I think that actual goal was mentioned in the forum thread on the XDA Dev forum where I learned about this. You could try looking through that thread. The thread is in regards to a keyboard remapping utility they are working on. The thread shouldn't be too deeply buried as I just posted on that thread last night. If you don't find it I can send you a link to it when I get near my PC again.
 
You know, since your backspacing already, why not set that home key to be an extra backspace key? Just a thought.
 
What about disabling a key altogether. My wife's Ally is having problems with the camera popping up, and it's showing the camera button is being pressed, when it actually isn't. I would like to just disable it.


Never mind, just figured it out. Thanks for this useful post!:D
 
I'm glad you worked it out. In essence, what I did by reassigning a spacebar press to the keyboard's Home button was to disable it. Pressing the spacebar would most likely be ignored if I were not running something which could accept character input. I can happily report that my making that change has repeatedly saved me from the PITA I used to frequently endure when accidentally pressing that key during typo corrections. :) I doubt I'll ever want to change it back.
 
What I did is left the key assigned to camera blank. The only side effect was that it also killed the back key on screen and the search key, which i don't use anyway. May go back later and try inserting space instead just to see what it does, but until then I accomplished my goal and the camera doesn't pop up!:D
 
I was just wondering if anyone has ever used what looks like a tab button on the alternate for Q? I was going to type up an essay on my phone and I tried using it to indent my paragraph but it didn't work so I tried using it on the messaging app and a few other places and still nothing. I doubt its just my keyboard but I was just wondering if it works for anyone else.
 
Someone should repost this guide as a sticky. Just remapped my home key to a tab key. It's nice to *finally* have a tab key for autocomplete when in the terminal (plus no more returning home while backspacing).

On a side note, tab doesn't seem to respond in most android apps. Probably because they don't put one on most keyboards. Might be a good choice for those trying to disable keys.

Edit: Didn't even read the post above before posting. All I can say about alt+q is that I know it doesn't register to the terminal app as being "tab". I don't know if *any* apps use it either.
 
FWIW I just tested trying to use the ALT+Q "tab" key in files such as Docs to Go Word and Excel, as well as Thinkfree Office doc and xls files, and I can't get it to work either. I searched the entire Ally User Manual (in PDF) and found nothing on a tab key. On page 22 you can see it in the drawing, but they make no reference to it. My guess is that it is not implemented in Verizon's version of this phone.

KuroTsubasa, does the new tab key assignment actually work like a tab key in a document or spreadsheet?
 
A little update on what I did. After about a day, the physical keyboard disabled itself. So long story short, don't just leave the function for a key blank. I will try a few other things and keep you posted.
 
Back
Top Bottom