I'm currently on CM12.1 and one of the best things I love about it is the ability to change the function of the buttons. I've always thought that the Menu button is useless so I changed it to bring up the Recent Apps Switcher. Now that I'm thinking of flashing the official Lollipop update, is there a way to change the funcion of the buttons?
VIPNobie said:
I'm currently on CM12.1 and one of the best things I love about it is the ability to change the function of the buttons. I've always thought that the Menu button is useless so I changed it to bring up the Recent Apps Switcher. Now that I'm thinking of flashing the official Lollipop update, is there a way to change the funcion of the buttons?
Click to expand...
Click to collapse
Do a little research into the gpoi-keys.kl file. It's located in /system/usr/keylayout/ It controls the function of all the buttons on your phone, so by changing the values in this file you can change the function of some of your buttons. Just make sure you back that file up in case you break something.
Devo7v said:
Do a little research into the gpoi-keys.kl file. It's located in /system/usr/keylayout/ It controls the function of all the buttons on your phone, so by changing the values in this file you can change the function of some of your buttons. Just make sure you back that file up in case you break something.
Click to expand...
Click to collapse
Say I successfully changed the button function, will there be a 3-dot menu on all apps automatically? Or will I be unable to access the menu?
VIPNobie said:
Say I successfully changed the button function, will there be a 3-dot menu on all apps automatically? Or will I be unable to access the menu?
Click to expand...
Click to collapse
I honestly don't know, you can try it and find out. If you can't access the menu you can always change you buttons back, that's why you make a backup.
Successfully remapped the Menu Button. I edited two files in /system/usr/keylayout/: generic.kl and gpoi-keys.kl
In generic.kl:
I changed the following lines
Code:
key 139 [B]MENU[/B]
key 217 [B]SEARCH[/B]
to
Code:
key 139 [B]APP_SWITCH[/B]
key 217 [B]MENU[/B]
In gpoi-keys.kl
I changed the following lines
Code:
key 139 [B]MENU[/B]
to
Code:
key 139 [B]APP_SWITCH[/B]
Key 139 is short-press of the Menu Button while 217 is long-press. I didn't want to go into trouble of making the 3-dot menu appear in apps so I decided to reassign the latter from search to menu.
VIPNobie said:
Successfully remapped the Menu Button. I edited two files in /system/usr/keylayout/: generic.kl and gpoi-keys.kl
In generic.kl:
I changed the following lines
Code:
key 139 [B]MENU[/B]
key 217 [B]SEARCH[/B]
to
Code:
key 139 [B]APP_SWITCH[/B]
key 217 [B]MENU[/B]
In gpoi-keys.kl
I changed the following lines
Code:
key 139 [B]MENU[/B]
to
Code:
key 139 [B]APP_SWITCH[/B]
Key 139 is short-press of the Menu Button while 217 is long-press. I didn't want to go into trouble of making the 3-dot menu appear in apps so I decided to reassign the latter from search to menu.
Click to expand...
Click to collapse
I'm glad evening worked out for you. Good job.
Related
I am interested in remapping the key to take a photo using the htc camera. Has this been done, or is it even possible? I found nothing specific to the hero in my searches so I'm not sure. I just hate using the trackball.
barnacles10 said:
I am interested in remapping the key to take a photo using the htc camera. Has this been done, or is it even possible? I found nothing specific to the hero in my searches so I'm not sure. I just hate using the trackball.
Click to expand...
Click to collapse
Just edit the heroc-keypad.kl(may have a different name) in system/usr/keylayout;
I always remap my "phone" button to be the "camera" instead, and then I use the "search" button for autofocus.
Decad3nce said:
Just edit the heroc-keypad.kl(may have a different name) in system/usr/keylayout;
I always remap my "phone" button to be the "camera" instead, and then I use the "search" button for autofocus.
Click to expand...
Click to collapse
So I just opened the heroc-keypad and I honestly don't know what to do in there or rather what does what. I'm real interested in this since i don't use my volume keys and eventually when the I1 comes out on sprint which will be the first sprint phone with push to talk and android I would like to port it to our phones (or try) so that we have ptt
thatguythatdid said:
So I just opened the heroc-keypad and I honestly don't know what to do in there or rather what does what. I'm real interested in this since i don't use my volume keys and eventually when the I1 comes out on sprint which will be the first sprint phone with push to talk and android I would like to port it to our phones (or try) so that we have ptt
Click to expand...
Click to collapse
Well essentially it shows you what key does what.
Code:
key 102 HOME
key 139 MENU WAKE_DROPPED
key 158 BACK
key 127 FOCUS
key 231 CAMERA
key 107 ENDCALL WAKE_DROPPED
key 191 DPAD_CENTER
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
Key 231 is usually "CALL" and Key 127 is usually "SEARCH"
I just went in and changed it to "CAMERA" and "FOCUS" and then pushed the file back to system/usr/keylayout/
You can also change things like "WAKE" if you want the action to wake the phone from sleep. It wouldn't be too hard to create a new action to be called by the physical button push. Though I haven't tinkered around too much with that.
Thanks gonna try some things out
thanks, I might try this. So what happens when you push the phone button on the home screen say. Does your camera boot?
barnacles10 said:
thanks, I might try this. So what happens when you push the phone button on the home screen say. Does your camera boot?
Click to expand...
Click to collapse
Yep, sometimes requires a long-press though.
Then if I push "Search" for auto-focus, followed by "Phone" again for camera, it takes a snap shot.
Really handy.
I TAKE NO CREDIT FOR THIS LITTLE HACK, THIS WAS DONE FOLLOWING THE INSTRUCTIONS FROM THIS SITE.
ALL CREDIT GOES TO Decad3nce for making this as easy as 1,2,3.
---------------------------------------------------------------------------------------------------------------------------
THIS SHOULD WORK ON ANY 2.2 ROM. I DON'T KNOW ABOUT 2.1.--------------------------------------------------------------------------------------------------------------------------------------------------------------
***INSTRUCTIONS***
1) Download the file HERE
2) put the "incrediblec-keypad.kl" file you just downloaded into the TOOLS folder of your Android-SDK folder.
3) run this:
Code:
adb remount
adb push incrediblec-keypad.kl /system/usr/keylayout
4) Reboot your phone, and then long press the search key to check it out!
-------------------------------------------------------------------------------------------------------------------------------------
UPDATE
Big Thanks to Touchpro247 over on at for putting together a .zip to flash via recovery!
"Just install via recovery.
or
Un-install via recovery."
no way! i requested this exact feature a while ago on android forums but seemed nobody was interested. so i gave up, haha. so stoked to see this, at work right now, but i am def gonna install this when i get home. thank you!
Awesome find! I like to use my voice search for the search button so I instead mapped camera to the long press menu button.
Is there a way to get this working with optical pad?
Didn't think the whole menu button thing to thoroughly. Going back to Search button.
Thanks a bunch for the support guys!
I'm not too sure about the optical trackpad sorry man!
Would people be able to use Root Explorer to copy the file into designated location? I renamed the original file, just to be safe and copied the new one...then rebooted and it disabled all the soft keys...so I am back to the original for now.
Here's an update.zip for it.
Just install via recovery.
or
Un-install via recovery.
Thanks for posting!
touchpro247 said:
Here's an update.zip for it just install via recovery.
Thanks for posting!
Click to expand...
Click to collapse
Awesome touchpro...
Reason, I did it that way was I wanted to keep the original for backup. I will try update.zip. Thanks!
Tats_06 aka olta777
touchpro247 said:
Here's an update.zip for it just install via recovery.
Thanks for posting!
Click to expand...
Click to collapse
Your welcome man, thanks for posting this, I tried and tried to do this and couldn't get it. I appreciate it. updating OP.
op, thanks for posting
When I edited the the incrediblec-keypad.kl file to use a long press of the Menu button, the short press of the Menu button stopped working. So, no more menu access.
What am I doing wrong? Thanks.
Code:
key 107 ENDCALL WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 CAMERA WAKE_DROPPED
key 102 HOME WAKE_DROPPED
So, would replacing the key ID with the ID of the optical trackpad button work?
Good questions guys I wish I could be of some help but I don't know much about this stuff
WOW, this works perfectly! Thanks for posting...I always hated the search button anyway.
INTREPID-NY said:
When I edited the the incrediblec-keypad.kl file to use a long press of the Menu button, the short press of the Menu button stopped working. So, no more menu access.
What am I doing wrong? Thanks.
Code:
key 107 ENDCALL WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 217 SEARCH WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 139 CAMERA WAKE_DROPPED
key 102 HOME WAKE_DROPPED
Click to expand...
Click to collapse
Curious, did you edit it in a "unix" editor? If you used something like notepad to change it and save it, it would be saved in the DOS format. I wonder if using something like Textpad to open and save it in UNIX text format would make it work...
I used ultraedit - it may have saved it in DOS format. I'll give it another try and make sure it saves as Unix.
Is there a way to make the the search function still work on a short press? When I short press my search button it does nothing but when I long press it brings up the camera...any fix would be great thanks!
AisforAustin said:
Is there a way to make the the search function still work on a short press? When I short press my search button it does nothing but when I long press it brings up the camera...any fix would be great thanks!
Click to expand...
Click to collapse
if you do that, it may wanna bring up the search menu while you are taking a picture with this button (when camera app is open).
Farenhe1t said:
WOW, this works perfectly! Thanks for posting...I always hated the search button anyway.
Click to expand...
Click to collapse
yes , I think so.
Can anyone point me in the right direction of a droid incredible keymap? It doesn't seem that pressing the optical track pad button is mapped to anything easily recognizable in the qwerty.kl file, so I'm not sure how to find the button's ID. I looked in the optical trackpad wake thread, but the only difference I could see between that file and the one on my phone is that key 232 was changed from WAKE to WAKE_DROPPED, which I imagine wouldn't change whether the key could wake from sleep or not. I tried using the zip in this thread modified to sub in key 232 (dpad center, seems like maybe thats opti trackpad press) but it did not launch the camera as expected.
As far as I'm concerned, the ideal button mapping would be pressing the opti track pad to launch the camera app, and swiping any direction on the opti track pad to take a picture from within the camera app. First step is to get that button to launch the app, which is preferable to rebinding search, since the opti button isn't used for anything anyways.
Any help would be greatly appreciated.
im currently trying to remap the short press on my milestone to act as the long press (so i can set it to open quick settings on short press) and then the long press can be set to the search. could anyone point me in the right direction? i know how to remap keys but im having trouble changing the short and long press for my search key.
Is there any way to replace the Long Press on the Home Button?
As in, make it open Switcher, or some other multi-tasking app.
CyanogenMod has this, and I was wondering if it could be ported to another ROM somehow.
I think I might actually know this one. I can't find the exact thread cause for some reason search has been broken for days for me.
In the /system/usr/keylayout folder is a file called melfas-touchkey.kl
I think that's the file that controls the keypresses for those buttons. I'd have someone smarter then me come and verify that though.
miztaken1312 said:
I think I might actually know this one. I can't find the exact thread cause for some reason search has been broken for days for me.
In the /system/usr/keylayout folder is a file called melfas-touchkey.kl
I think that's the file that controls the keypresses for those buttons. I'd have someone smarter then me come and verify that though.
Click to expand...
Click to collapse
Inside, all it says is:
Code:
key 158 MENU WAKE_DROPPED
key 139 HOME WAKE_DROPPED
key 28 BACK WAKE_DROPPED
key 107 SEARCH WAKE_DROPPED
I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Tried hard reset?
XDRdaniel said:
I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Click to expand...
Click to collapse
Can't...
Sent from my GT-S5570 using xda app-developers app
try key remapping
manoj94 said:
try key remapping
Click to expand...
Click to collapse
Edit sec_key.kl in /usr/keylayout to your liking, is very easy to edit
Format (I believe) is the following
key # is what physical key is selected - action done by that key - if it should wake up the phone
Code:
key 158 BACK
key 102 HOME WAKE
key 139 MENU
key 107 POWER WAKE
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 28 DPAD_CENTER
key 106 DPAD_RIGHT
key 105 DPAD_LEFT
key 103 DPAD_UP
key 108 DPAD_DOWN
key 217 SEARCH
key 231 CALL
key 228 CAMERA
Then push it to your phone/put in your ROM and reboot.
Paul L. said:
Edit sec_key.kl in /usr/keylayout to your liking, is very easy to edit
Format (I believe) is the following
key # is what physical key is selected - action done by that key - if it should wake up the phone
Code:
key 158 BACK
key 102 HOME WAKE
key 139 MENU
key 107 POWER WAKE
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 28 DPAD_CENTER
key 106 DPAD_RIGHT
key 105 DPAD_LEFT
key 103 DPAD_UP
key 108 DPAD_DOWN
key 217 SEARCH
key 231 CALL
key 228 CAMERA
Then push it to your phone/put in your ROM and reboot.
Click to expand...
Click to collapse
that's not what i meant....
on certain miui roms, if you long press power button it collapses statusbar, instead of showing power menu. I think the command is somewhere in framework-res.apk, but i'm not sure.
XDRdaniel said:
that's not what i meant....
on certain miui roms, if you long press power button it collapses statusbar, instead of showing power menu. I think the command is somewhere in framework-res.apk, but i'm not sure.
Click to expand...
Click to collapse
Disable power control. Try play more with ROM !
F4uzan said:
Disable power control. Try play more with ROM !
Click to expand...
Click to collapse
you mean to do that by editing build.prop? Because i don't think power control can be disabled from settings....
XDRdaniel said:
you mean to do that by editing build.prop? Because i don't think power control can be disabled from settings....
Click to expand...
Click to collapse
Settings > Toggle. Play there.
XDRdaniel said:
I want to change hardware keys function on my rom. So that when screen is off, volume buttons skip music. And also when phone is active, long press on power button opens statusbar instead of power menu and it's annoying. To open power menu i have to long press power button from lockscreen. How can i change button's funcions?
Click to expand...
Click to collapse
For volume button music control search for a guide. Its somewhere in android.policy.jar
Sent from my GT-S5570 using xda app-developers app
arpitkh96 said:
For volume button music control search for a guide. Its somewhere in android.policy.jar
Sent from my GT-S5570 using xda app-developers app
Click to expand...
Click to collapse
That was the answer to both of my problems. I replaced android.policy.jar with one that i knew was working
thank you
XDRdaniel said:
That was the answer to both of my problems. I replaced android.policy.jar with one that i knew was working
thank you
Click to expand...
Click to collapse
Ma pleasure
Sent from my GT-S5570 using xda premium
I changed the recent app button to menu button in Generic.kl
I just find the key 254 can change form APP_SWITCH to MENU
But how can I change long pree button?
What is the key number of long press BACK key and long press MENU key and long press HOME key?
I can't find above 3 number in the Generic. kl .
billyhaha said:
I changed the recent app button to menu button in Generic.kl
I just find the key 254 can change form APP_SWITCH to MENU
But how can I change long pree button?
What is the key number of long press BACK key and long press MENU key and long press HOME key?
I can't find above 3 number in the Generic. kl .
Click to expand...
Click to collapse
Did you ever figure this out? I'm running a note 5 ROM on my GS5 and I'm really missing this functionality... Currently long press on app switch button opens multi window. Thunderbolt 2.8.1 ROM.