[Optimus One, P500, V General] N00b-un-2:
I don't know about everyone else, but I've found that I instinctively want to push the home button on my phone when I want to end a call. It's burned me SOOOOO many times. I think it's funny how many Android devices seem to have their buttons mapped wrong! For example, I just bought a Coby Kyros 7015A tablet and it has a "rocker" style button on the top that just logically seems like it should be a volume up/down rocker, but for some odd reason they decided to assign "home" and "Menu" to the two sides of the rocker. In addition, the big silver button in the middle seems like it should logically be the Home button, but it is the back button instead.

After a little fiddling around with my Kyros tablet I discovered where the keymapping files are located:

/system/usr/keylayout/

there are two plain text files in this directory which need to be modified in order to make changes to keymapping, "qwerty.kl" and the other one is going to be named something to do with your particular device. You will need to edit them with a Unix compatible editor like Notepad++ on Window$, but Gedit or Kate will do just fine on Linux.

After successfully remapping the "back" button as "home" and the home/menu as volume up/down on my Kyros, I decided to tackle setting a button to hang up on my Optimus. Of course the first thing I did was make a backup in the recovery.

NOTE! This may not be a great idea for every ROM. Make sure that before you proceed, your ROM has "Spare Parts" and you can change the default behavior of the "end" button. The default behavior of the End button is to shut the screen off and it can not be changed on some ROMs.

This goes without saying, but you are editing files in /system/ so you will need to be rooted.

On the Optimus running CM7, the two files you need to edit are "qwerty.kl" and the other file is called "thunder_keypad.kl"

adb pull /system/usr/keylayout/

* make sure you put that last / at the end! it tells it to pull all of the files in the directory.

Editing these files is a pretty straightforward process. Basically, after you pull the files from your phone, you open the files and replace the instances of "HOME" with "ENDCALL". Save the files and push them back to the device, and then reboot. That's it!

adb push qwerty.kl /system/usr/keylayout/qwerty.kl
adb push thunder_keypad.kl /system/usr/keylayout/thunder_keypad.kl
adb reboot

Now you can hit the home button to hang up during a phone call instead of having to hit one of the hardware buttons to wake up the phone, which usually puts you at your homescreen or somewhere else just to have to get back into the phone call and hit the soft button hopefully before the screen goes black because of the proximity sensor (it's designed to do that!)

Like I had mentioned earlier, you're going to want to go into spare parts and change the default "End" button behavior to "Go to Home". Basically you remapped the end call button to where your home button is and then you're telling the Android OS that the end call button will emulate the normal behavior of the home button. Make sense? Didn't think so...

Works great on Mik's CM7. The only "bug" i've found so far is that when you're in the app drawer, hitting home doesn't take you back to your homescreen.