Assign a button to hang up! - Optimus One, P500, V General

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:
Code:
/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"
Code:
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!
Code:
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.

Here are my edited .kl files
Just in case you're really REALLY lazy and don't want to take the time to edit the files yourself (or if you don't have a Unix compatible editor)
Just remount and push them to /system/usr/keylayout/

Related

Volume Buttons

I have a problem, I want to disconnect the down button on the side of my Touch Pro. I have a bad habit I can't seem to break when I grab the phone my finger presses the down volume and shuts off the phone. So I would like to deactivate that button. Please don't just tell me to edit the registry without explaining how to do it step by step. Even though I have edit the registry before, I am not that familular with it. Thanks for the help.
Disconnecting the vol buttons
You can install the cab attached, soft reset, then go into settings>system>keyboard config. Press menu on the bottom right corner, then select add key. It will say hold the key you want to configure, or something like that, so hold the vol down key. Then it will pop up a new window, just tap apply/OK. Then tap update config. Bingo! You got it.
You can also edit what the keys do, too. Just ask if you want to.
Please tell me if this is too hard, because then I will post screenshots.
I have done this on my verizon tp.

[how-to] remap genius key

1) Boot in to ClockworkMod Recovery
2) mount /system from partitions menu
3) adb pull /system/usr/keylayout/latte-keypad-v2.kl latte-keypad-v2.kl
4) Edit file locally, the genius key is: key 187 (make a backup of the original file first)
5) adb push latte-keypad-v2.kl /system/usr/keylayout/
6) Reboot
For more information on remapping keys see: http://forum.xda-developers.com/showthread.php?t=695936
If you want the genius button remaped to ENDCALL (if on a call it will end the call, if not on a call it will lock the screen, if you hold it down it activates the power button menu) and don't won't to edit the file yourself you can download this premodified version, just place it in the directory you are running adb from and skip steps 3&4): http://www.4shared.com/file/ein06_25/latte-keypad-v2.html
Notes:
There is a slight hardware delay on the button press, so whatever you assign it to you need to hold the button for half a second just like with the current genius app.
It does not seem to be any easy task to be able to call an alternate application, for now, you can only reassign the key to something another key already does (letter/number, end call, power, volume, camera, etc.). I'm currently working on being able to call an alternate application.
falken98 said:
1) Boot in to ClockworkMod Recovery
2) mount /system from partitions menu
3) adb pull /system/usr/keylayout/latte-keypad-v2.kl
4) Edit file locally, the genius key is: key 187
5) adb push /system/usr/keylayout/latte-keypad-v2.kl
6) Reboot
For more information on remapping keys see: http://forum.xda-developers.com/showthread.php?t=695936
Click to expand...
Click to collapse
Well, how about that. Great find, falken98!
Complete aside: Is your handle taken from the movie "WarGames"? If so, awesome.
So what are people planning to map to this particular hardware key?
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
Sure can, to make end call just change:
key 187 FUNC_4
to:
key 187 ENDCALL WAKE_DROPPED
HebrewToYou said:
Complete aside: Is your handle taken from the movie "WarGames"? If so, awesome.
Click to expand...
Click to collapse
haha. yes, it is. nice catch!
and what about the sleep functionality like on the old mytouch?
YESSS
i started a thread on this and was hard into figureing this out
thanks for the help
kingofyo1 said:
and what about the sleep functionality like on the old mytouch?
Click to expand...
Click to collapse
That i'm not sure about, i'll do some digging and see.
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
glad you asked this, that is what i want my genius button to be and it bugs me that it's not since i hit it all the time when trying to hang up on people(came from G1 so that's where my button was) i will do this later
managed to switch fn and menu on hw keyboard, it was bugging me that i constantly hit menu when trying to hit fn(bad button planning by HTC) but now i have the keys where i want them may have to make a few changes later as well to other stuff(camera and focus should do something else)
its not working whenever i put in adb pull "" it just gives me all the adb options..
kingofyo1 said:
and would we easily be able to make this a end call/sleep key? if so what needs to be changed
Click to expand...
Click to collapse
This is actually working this way for me. If on a call, I can hold it for about half a second, it will end the call. Press it for half a second again, it will put it to sleep. If I press and hold the key, it will bring up the Power options menu. This is after I mapped key 187 to ENDCALL WAKE_DROPPED.
Edit: Also, I love "187" being the Genius key
squidbutt said:
its not working whenever i put in adb pull "" it just gives me all the adb options..
Click to expand...
Click to collapse
Sure you have it typed correctly?
D:\android-sdk-windows\key> adb pull /system/usr/keylayout/latte-keypad-v2.kl
358 KB/s (3675 bytes in 0.010s)
fermunky said:
This is actually working this way for me. If on a call, I can hold it for about half a second, it will end the call. Press it for half a second again, it will put it to sleep. If I press and hold the key, it will bring up the Power options menu. This is after I mapped key 187 to ENDCALL WAKE_DROPPED.
Click to expand...
Click to collapse
That does turn out rather well for that button! No more annoying "say a command".
to make it a search key I:
key 187 FUNC_4
to:
key 187 SEARCH
??
Great find man, I switched it to end call/dropped too and its working perfectly. If anyone figures out before I do to make it the sleep function please post.
FYI, after you remap the key it seems to be safe to go ahead and remove:
vsuite.apk, vsuite.odex, VSuiteApp.apk, VSuiteApp.odex
If you have no interest in the genius button function.
what does the WAKE_DROPPED mean
btw when I pull the file where does it pull to? my sdcard or do I have to put a directory? Someone should just upload the stock file
turboyo said:
what does the WAKE_DROPPED mean
Click to expand...
Click to collapse
WAKE: When this key is pressed while the device is asleep, the device will wake up and the key event gets sent to the app.
WAKE_DROPPED: When this key is pressed while the device is asleep, the device will wake up and the key event does not get sent to the app.
If we figure out how to put the device the sleep there would actually be a difference.
turboyo said:
btw when I pull the file where does it pull to? my sdcard or do I have to put a directory? Someone should just upload the stock file
Click to expand...
Click to collapse
It pulls it to the computer you ran adb from (in the directory you are in), you then edit the file with a text editor and push it back up.
Since you have to edit the file and push it back you might as well just go ahead and pull it first, seems more annoying to try and download it first.
Im getting the same thing with it just listing all the adb commands.. Ahh things like this were so much easier with SUFBS lol, all I would have to do is go to the directory and edit the file right in there

[Q] Using menu button to pick up call

Hi there. The topic says it all. Does there a way exist for me to use my menu button (the physical button) to pick up a call? I looked around in the settings, (I'm on ICS Final Mod, kevinlekiller's) couldn't find it.
Tried to look for it, but turned up empty handed. So, does it exist?
Nope it doesn't. Never heard of such a thing.
You can edit /system/usr/keylayout/sec_key.kl .
ketut.kumajaya said:
You can edit /system/usr/keylayout/sec_key.kl .
Click to expand...
Click to collapse
sec_key.kl is not present. The following files are present
Code:
AVRCP.kl
qwerty.kl
sec_touchscreen.kl
I looked around but it seems to me that remapping would change the keys behavior for the entire time, but the key mapping should change only when there is an incoming call.
Okay so there is no key state as such for picking up a call. The nearest key state being ENDCALL (ironically).
Code:
HOME #Launches "Home"
MENU #Launches "Menu"
BACK #Takes you back to the last activity
SEARCH #Launches "Universal Search"
CALL #Launches the "Phone" activity and corresponding .apk or initiates a call
ENDCALL #Ends a call
CAMERA #Launches "Camera" activity and corresponding .apk
FOCUS #Initiates Auto-Focus while using the Camera
VOLUME_UP #Self explanatory
VOLUME_DOWN #^
The above is from the here
In the above link, Decad3nce puts forward the idea of custom app launching inspired by BuglessPete's How to make script run by using hardware keys
After reading both, I think might be a way of enabling the menu key/home key to pick up a call.

[Q] any key droid x2 screen awake

Is there a way to have any hard key unlock the droid x2
I do remember reading about this in the developement section. There's something to change in one of the scripts, but I don't remember exactly where or what it was. Try the search or browse around a bit. It's there.
Sorry I wasn't much help.
If you flash CM7 you can have the home key and volume keys unlock the screen.
Settings--CyanogenMod settings--Input--check the box for "volume rocker wake."
I think "home key wake" might be on by default.
Read through this thread:
http://forum.xda-developers.com/showthread.php?t=1403013
I asked the same question in there. There is a file you can edit that can change the actions of the hard buttons. Just be sure to make a backup of the original file when you do it.
EDIT: Not sure if you have to have a certain amount of posts to see links. So heres a quick summary.
In a file explorer, go to /system/usr/keylayout. Open the tegra-kbc.kl file in a text editor (You have to give read/write permissions to edit and save this file on your phone) and you can change the menu, back, search and volume buttons from WAKE_DROPPED to WAKE. Notice how the home button is the only one set to "WAKE". This will make all the buttons wake from the screen being off like the home button does. Again, backup the file first in case something doesnt work right. Im not responsible if you mess something up. But this should work fine.
When I first did this, I did that to the volume buttons and it worked. So it should work with the other buttons as well.
They won't take until after a reboot. I edited the same file to make my search button open my camera.
Sent from my CM7 DEATHMACHINE!
Thanks everyone
I tried this b4 and did something wrong as the phone went dark and would not turn on. Somehow I got to factory reboot and brought it to VW and they replaced.
jsgraphicart said:
Read through this thread:
http://forum.xda-developers.com/showthread.php?t=1403013
I asked the same question in there. There is a file you can edit that can change the actions of the hard buttons. Just be sure to make a backup of the original file when you do it.
EDIT: Not sure if you have to have a certain amount of posts to see links. So heres a quick summary.
In a file explorer, go to /system/usr/keylayout. Open the tegra-kbc.kl file in a text editor (You have to give read/write permissions to edit and save this file on your phone) and you can change the menu, back, search and volume buttons from WAKE_DROPPED to WAKE. Notice how the home button is the only one set to "WAKE". This will make all the buttons wake from the screen being off like the home button does. Again, backup the file first in case something doesnt work right. Im not responsible if you mess something up. But this should work fine.
When I first did this, I did that to the volume buttons and it worked. So it should work with the other buttons as well.
Click to expand...
Click to collapse

[Q] Disable power/lock button

I've read a lot of really good info on this site, but can't seem to find exactly what i'm looking for. i have a cheap Visual Land Connect table that runs ICS. It was dropped on the power/lock button and now the button has no resistance. It doesn't click anymore. I rigged my tablet so i can still use it but it isn't great. what i'm looking to do is disable the power button and us the Back button instead. is this possible. Using ES File Explorer, i've gone into the key layout files and tried a few things in there but nothing i do there seems to work. Each time i manipulate a file it creates a .bak file. i think this is normal. do i need to delete this? Also, there are a bunch of key layout files in there. not really sure which one to do. even if i can disable the power button once its turned on, and map a different button to do this, that would work. any suggestions?

Categories

Resources