Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,811,629 Members 54,255 Now Online
XDA Developers Android and Mobile Development Forum

Hardware Keys

Tip us?
 
jonahly
Old
#1  
jonahly's Avatar
Senior Member - OP
Thanks Meter 130
Posts: 635
Join Date: Oct 2012
Location: Ashland
Default Hardware Keys

Hardware keys have also been an issue getting disabled for me. I want to get my hardware keys disabled and just use soft keys to have more of a nexus feel but what ever I do, editing the generic.kl file, using apps designed for it, or blowing up Earth nothing works . Any ideas? It just won't stick.

Sent from my Optimus G using xda app-developers app
Devices
Sprint LG Optimus G
ROM: Blue Lightning
Kernel: 1.7Ghz
Lenovo ThinkPad A1000
Soft-Bricked.
The Following User Says Thank You to jonahly For This Useful Post: [ Click to Expand ]
 
enjoyspigeons
Old
#2  
Junior Member
Thanks Meter 6
Posts: 6
Join Date: Oct 2013
Hi, I think I can help. and i just had way to much fun messing with the .kl files (im a geek...) also, since im also using cm11 hopefully they match up to yours.

ok just to clarify(ive never used a nexus) but I'm guessing you want to disable the "back", "home" and "menu" capacitive keys and you're gonna use on-screen buttons? but you still want the volume and power keys?

At first I was gonna suggest using an xposed module to disable the keys. I already use them to "enhance" those keys(double tap "back" switches to last app, long pressing "back" kills current app, etc.etc.) So for what you want, i disabled my gravity box module and installed the xposed additions module and I was successful in disabling the keys(and if you want, you can even set the double tap as the original key function, so single press no "home", double tap "home"...)

Alternatively, looking at the "keylayout" folder, I think you are changing the wrong file. The generic.kl file is not the default keylayout, it's more of a backup in case the vendor doesn't provide a better one. If you look at the file "touch_dev.kl" you'll see four keys that map to the home back and menu, and they are set as virtual. Sooo, i changed the name of the file to "touch_dev.bak" or whatever you want, and after rebooting, NOW it uses the generic.kl file. As a little nifty extra, inside the generic.kl file it sets "menu" and "back" as wake_dropped, so even if the screen is off, pressing either key will wake up the screen. Tho I imagine that might be too easy to accidentally push them while in your pocket. And since we both use neighborhood hackers kernel, the "swipe screen" is probably a better way to turn on the screen.

ok back to you... (and also, make sure you have your onscreen buttons turned on as it can be awkward to navigate without "home" or "back" function) If you now rename the "generic.kl" file to "generic.bak"(or whatever....) and reboot, NOW it should be the way you want. Dont worry, the file "pmic8xxx_pwrkey.kl" will control the power key and "keypad_8064.kl" will control the volume keys. Worked for me at least.

And I should probably mention to make a copy of the whole "keylayout" folder and to also be careful to not delete "pmicxx_pwrkey.kl" as that cause some issues (you should be able to turn on the screen by swiping, but not sure how it effects the deeper power off, power on functions....)

So yeah hope you or others find this useful (and coherent..) as i just got off work a bit ago and sleepy.... and i tend to use run on sentences and and and and lol
The Following 3 Users Say Thank You to enjoyspigeons For This Useful Post: [ Click to Expand ]
 
R.Suave
Old
(Last edited by R.Suave; 23rd February 2014 at 08:13 PM.)
#3  
R.Suave's Avatar
Senior Member
Thanks Meter 1,103
Posts: 441
Join Date: Apr 2013
Location: Texas

 
DONATE TO ME
Quote:
Originally Posted by enjoyspigeons View Post
Hi, I think I can help. and i just had way to much fun messing with the .kl files (im a geek...) also, since im also using cm11 hopefully they match up to yours.

ok just to clarify(ive never used a nexus) but I'm guessing you want to disable the "back", "home" and "menu" capacitive keys and you're gonna use on-screen buttons? but you still want the volume and power keys?

At first I was gonna suggest using an xposed module to disable the keys. I already use them to "enhance" those keys(double tap "back" switches to last app, long pressing "back" kills current app, etc.etc.) So for what you want, i disabled my gravity box module and installed the xposed additions module and I was successful in disabling the keys(and if you want, you can even set the double tap as the original key function, so single press no "home", double tap "home"...)

Alternatively, looking at the "keylayout" folder, I think you are changing the wrong file. The generic.kl file is not the default keylayout, it's more of a backup in case the vendor doesn't provide a better one. If you look at the file "touch_dev.kl" you'll see four keys that map to the home back and menu, and they are set as virtual. Sooo, i changed the name of the file to "touch_dev.bak" or whatever you want, and after rebooting, NOW it uses the generic.kl file. As a little nifty extra, inside the generic.kl file it sets "menu" and "back" as wake_dropped, so even if the screen is off, pressing either key will wake up the screen. Tho I imagine that might be too easy to accidentally push them while in your pocket. And since we both use neighborhood hackers kernel, the "swipe screen" is probably a better way to turn on the screen.

ok back to you... (and also, make sure you have your onscreen buttons turned on as it can be awkward to navigate without "home" or "back" function) If you now rename the "generic.kl" file to "generic.bak"(or whatever....) and reboot, NOW it should be the way you want. Dont worry, the file "pmic8xxx_pwrkey.kl" will control the power key and "keypad_8064.kl" will control the volume keys. Worked for me at least.

And I should probably mention to make a copy of the whole "keylayout" folder and to also be careful to not delete "pmicxx_pwrkey.kl" as that cause some issues (you should be able to turn on the screen by swiping, but not sure how it effects the deeper power off, power on functions....)

So yeah hope you or others find this useful (and coherent..) as i just got off work a bit ago and sleepy.... and i tend to use run on sentences and and and and lol
Great info here.

My girlfriend's LGOG just got dropped in the sink. We waited a week and everything is good and powered on but the Power/ScreenLock button must be pressed extremely hard for the phone to register it. Do you have any idea how i can re-route the power button in a way that would still allow powering on with the new button?

Thanks a lot

Btw, the phone is rooted and running beanstalk

EDIT: I changed the function of the volume up key to work as the power/wake and everything seems good while the phone is on but it seems like it wont power the device on from a complete off state. Any ideas on a remedy?
 
enjoyspigeons
Old
#4  
Junior Member
Thanks Meter 6
Posts: 6
Join Date: Oct 2013
Quote:
Originally Posted by R.Suave View Post
Great info here.

My girlfriend's LGOG just got dropped in the sink. We waited a week and everything is good and powered on but the Power/ScreenLock button must be pressed extremely hard for the phone to register it. Do you have any idea how i can re-route the power button in a way that would still allow powering on with the new button?

Thanks a lot

Btw, the phone is rooted and running beanstalk

EDIT: I changed the function of the volume up key to work as the power/wake and everything seems good while the phone is on but it seems like it wont power the device on from a complete off state. Any ideas on a remedy?
Hi! Erm yeah I tried experimenting a little and now I'm pretty sure the buttons are handled differently at the lower software levels. Changing the keylayouts only affects the current ROM which makes sense since they are included with every rom and also we are able to navigate Recovery with no rom installed. I can't help much (everything I learn is mostly through google and experimenting), but maybe a kernel or firmware dev can help you.

But through experimenting, one minor way to help: When the phone is completely off, if you hold "volume up" while plugging in power cable, it will turn the phone on and load the "Fastboot" screen. You will still have to press the "power" button to boot normaly, but only a "short press" rather than a "long press". So that might help as I imagine getting it to register a long press is a pain.

Also, have you thought bout replacing the switch? its a tiny board and looks easy to get to. I took off my back cover and it doesnt seem like would to much harder to change it out. I looked on ebay and found this ebay dot com/itm/LG-Optimus-G-LS970-Sprint-Power-Button-Replacement-P912-/331129133388?pt=US_Cell_Phone_Replacement_Parts_To ols&hash=item4d18d5994c and also found this ebay dot com/itm/New-Torx-T4-common-size-for-cell-phones-Laptops-More-devices-/181131150696?pt=US_Cell_Phone_Replacement_Parts_To ols&hash=item2a2c420568
(sry it won't let me post outside links lol)If you'd like I can take it apart further and see how hard it is or you can look on youtube for better visual instructions

Ooohh! and as a no cost/irresponsible/last resort kinda option.... If you look at that replacement power switch ebay picture: See those two gold loops coming out the top on either side of the button? Bend a metal wire and touching those two loops will register as a button press and turn the phone on(tested by me woot!)

K, well hope I helped. Lates yo
The Following User Says Thank You to enjoyspigeons For This Useful Post: [ Click to Expand ]
 
R.Suave
Old
(Last edited by R.Suave; 27th February 2014 at 03:12 PM.)
#5  
R.Suave's Avatar
Senior Member
Thanks Meter 1,103
Posts: 441
Join Date: Apr 2013
Location: Texas

 
DONATE TO ME
Quote:
Originally Posted by enjoyspigeons View Post
Hi! Erm yeah I tried experimenting a little and now I'm pretty sure the buttons are handled differently at the lower software levels. Changing the keylayouts only affects the current ROM which makes sense since they are included with every rom and also we are able to navigate Recovery with no rom installed. I can't help much (everything I learn is mostly through google and experimenting), but maybe a kernel or firmware dev can help you.

But through experimenting, one minor way to help: When the phone is completely off, if you hold "volume up" while plugging in power cable, it will turn the phone on and load the "Fastboot" screen. You will still have to press the "power" button to boot normaly, but only a "short press" rather than a "long press". So that might help as I imagine getting it to register a long press is a pain.

Also, have you thought bout replacing the switch? its a tiny board and looks easy to get to. I took off my back cover and it doesnt seem like would to much harder to change it out. I looked on ebay and found this ebay dot com/itm/LG-Optimus-G-LS970-Sprint-Power-Button-Replacement-P912-/331129133388?pt=US_Cell_Phone_Replacement_Parts_To ols&hash=item4d18d5994c and also found this ebay dot com/itm/New-Torx-T4-common-size-for-cell-phones-Laptops-More-devices-/181131150696?pt=US_Cell_Phone_Replacement_Parts_To ols&hash=item2a2c420568
(sry it won't let me post outside links lol)If you'd like I can take it apart further and see how hard it is or you can look on youtube for better visual instructions

Ooohh! and as a no cost/irresponsible/last resort kinda option.... If you look at that replacement power switch ebay picture: See those two gold loops coming out the top on either side of the button? Bend a metal wire and touching those two loops will register as a button press and turn the phone on(tested by me woot!)

K, well hope I helped. Lates yo
Very helpful. Thank you !!!

edit: I searched around for an Optimus G repair video and/or instructions with no avail. If you wouldn't mind, taking yours apart further and seeing how hard it is to replace would be extremely helpful. There is a place here in my city that will replace it for 60 dollars but if I can get to it pretty easy, I'd rather do it myself. Thanks again.
 
Phone: Samsung Galaxy S4 (SGH M919)
Rom: Beanstalk v4.4.2
Recovery: TWRP v2.6

Other Devices - Nexus 7 - OG Evo 4g
 
jonahly
Old
#6  
jonahly's Avatar
Senior Member - OP
Thanks Meter 130
Posts: 635
Join Date: Oct 2012
Location: Ashland
Quote:
Originally Posted by enjoyspigeons View Post
Hi, I think I can help. and i just had way to much fun messing with the .kl files (im a geek...) also, since im also using cm11 hopefully they match up to yours.

ok just to clarify(ive never used a nexus) but I'm guessing you want to disable the "back", "home" and "menu" capacitive keys and you're gonna use on-screen buttons? but you still want the volume and power keys?

At first I was gonna suggest using an xposed module to disable the keys. I already use them to "enhance" those keys(double tap "back" switches to last app, long pressing "back" kills current app, etc.etc.) So for what you want, i disabled my gravity box module and installed the xposed additions module and I was successful in disabling the keys(and if you want, you can even set the double tap as the original key function, so single press no "home", double tap "home"...)

Alternatively, looking at the "keylayout" folder, I think you are changing the wrong file. The generic.kl file is not the default keylayout, it's more of a backup in case the vendor doesn't provide a better one. If you look at the file "touch_dev.kl" you'll see four keys that map to the home back and menu, and they are set as virtual. Sooo, i changed the name of the file to "touch_dev.bak" or whatever you want, and after rebooting, NOW it uses the generic.kl file. As a little nifty extra, inside the generic.kl file it sets "menu" and "back" as wake_dropped, so even if the screen is off, pressing either key will wake up the screen. Tho I imagine that might be too easy to accidentally push them while in your pocket. And since we both use neighborhood hackers kernel, the "swipe screen" is probably a better way to turn on the screen.

ok back to you... (and also, make sure you have your onscreen buttons turned on as it can be awkward to navigate without "home" or "back" function) If you now rename the "generic.kl" file to "generic.bak"(or whatever....) and reboot, NOW it should be the way you want. Dont worry, the file "pmic8xxx_pwrkey.kl" will control the power key and "keypad_8064.kl" will control the volume keys. Worked for me at least.

And I should probably mention to make a copy of the whole "keylayout" folder and to also be careful to not delete "pmicxx_pwrkey.kl" as that cause some issues (you should be able to turn on the screen by swiping, but not sure how it effects the deeper power off, power on functions....)

So yeah hope you or others find this useful (and coherent..) as i just got off work a bit ago and sleepy.... and i tend to use run on sentences and and and and lol
That's one step but what about disabling hardware key lights?

Sent from my LG-LS970 using XDA Premium 4 mobile app
Devices
Sprint LG Optimus G
ROM: Blue Lightning
Kernel: 1.7Ghz
Lenovo ThinkPad A1000
Soft-Bricked.
 
enjoyspigeons
Old
#7  
Junior Member
Thanks Meter 6
Posts: 6
Join Date: Oct 2013
Quote:
Originally Posted by jonahly View Post
That's one step but what about disabling hardware key lights?

Sent from my LG-LS970 using XDA Premium 4 mobile app
erm.. I'm not on CM11 anymore so I can't say for sure but isn't there usually a setting in "Display" or "Buttons"? It's normally near the setting that controls the button backlight timer.

I do remember one rom where I was unable to find this setting... so if that is the case then you can try creating an Init.d script with:
Code:
#!/system/bin/sh 
echo 0 > /sys/class/leds/button-backlight/brightness; echo 0 > /sys/class/leds/button-backlight/max_brightness
I'd elaborate more on that but I tried to set it on my current rom and I couldn't get the settings to stick lol but I've used this method before many times on other roms. I like to set the button brightness to 1 while most roms set it to 2 or 3(actually any number above 2 is max brightness) and I don't think I've ever seen a way to change it permanently without using this script at boot.

Oh you could also use expose modules to turn it off but I dont think there is one that does JUST that. I'm pretty sure Gravitybox has the option in there.

Oh and I use Lux and I saw an option in there too will turn off button backlight

So yeah many options.. Id try looking thru Settings tho.

---------- Post added at 12:01 PM ---------- Previous post was at 11:27 AM ----------

Quote:
Originally Posted by R.Suave View Post
Very helpful. Thank you !!!

edit: I searched around for an Optimus G repair video and/or instructions with no avail. If you wouldn't mind, taking yours apart further and seeing how hard it is to replace would be extremely helpful. There is a place here in my city that will replace it for 60 dollars but if I can get to it pretty easy, I'd rather do it myself. Thanks again.
It's real simple!!!

I took the back off (thats what the torx screwdriver is for) then after that unscrewed like 7 silver + screws holding the black plastic shield(?) and then used pliers to remove the little button-board. It not even really secured in there (it uses the two metal hooks to make contact with the mainboard) so you just lift it out (tho I had to use a tiny flat-head screwdriver to kinda press in the hooks in order to reinsert it) but it wasnt too bad. A lot better than paying 60 bux damn!! lol

But keep in mind... It's totally possible that the water damaged something else that could be harder to fix. Or alternatively, it could be easier. Maybe the water just rusted the metal contacts a little bit and just need a lil polishing

And I couldnt find any videos either that show the button-board clearly but this one does show taking off the back and the black plastic thing:
www.youtube dot com/watch?v=S4uspcvx3f0

I think after ten posts I'll be able to post outside links..... :P

well either way, good luck. If I can find something else to take pictures with then I could try posting some close ups of the board. But its really simple to get to.

K laters yo. Again, hope I helped!

oh and apologies to jonahly for sidetracking his thread a lil
The Following 2 Users Say Thank You to enjoyspigeons For This Useful Post: [ Click to Expand ]
 
R.Suave
Old
#8  
R.Suave's Avatar
Senior Member
Thanks Meter 1,103
Posts: 441
Join Date: Apr 2013
Location: Texas

 
DONATE TO ME
Quote:
Originally Posted by enjoyspigeons View Post
erm.. I'm not on CM11 anymore so I can't say for sure but isn't there usually a setting in "Display" or "Buttons"? It's normally near the setting that controls the button backlight timer.

I do remember one rom where I was unable to find this setting... so if that is the case then you can try creating an Init.d script with:
Code:
#!/system/bin/sh 
echo 0 > /sys/class/leds/button-backlight/brightness; echo 0 > /sys/class/leds/button-backlight/max_brightness
I'd elaborate more on that but I tried to set it on my current rom and I couldn't get the settings to stick lol but I've used this method before many times on other roms. I like to set the button brightness to 1 while most roms set it to 2 or 3(actually any number above 2 is max brightness) and I don't think I've ever seen a way to change it permanently without using this script at boot.

Oh you could also use expose modules to turn it off but I dont think there is one that does JUST that. I'm pretty sure Gravitybox has the option in there.

Oh and I use Lux and I saw an option in there too will turn off button backlight

So yeah many options.. Id try looking thru Settings tho.

---------- Post added at 12:01 PM ---------- Previous post was at 11:27 AM ----------



It's real simple!!!

I took the back off (thats what the torx screwdriver is for) then after that unscrewed like 7 silver + screws holding the black plastic shield(?) and then used pliers to remove the little button-board. It not even really secured in there (it uses the two metal hooks to make contact with the mainboard) so you just lift it out (tho I had to use a tiny flat-head screwdriver to kinda press in the hooks in order to reinsert it) but it wasnt too bad. A lot better than paying 60 bux damn!! lol

But keep in mind... It's totally possible that the water damaged something else that could be harder to fix. Or alternatively, it could be easier. Maybe the water just rusted the metal contacts a little bit and just need a lil polishing

And I couldnt find any videos either that show the button-board clearly but this one does show taking off the back and the black plastic thing:
www.youtube dot com/watch?v=S4uspcvx3f0

I think after ten posts I'll be able to post outside links..... :P

well either way, good luck. If I can find something else to take pictures with then I could try posting some close ups of the board. But its really simple to get to.

K laters yo. Again, hope I helped!

oh and apologies to jonahly for sidetracking his thread a lil
Once again a huge help. Thank you. And yes, Sorry jonahly
 
Phone: Samsung Galaxy S4 (SGH M919)
Rom: Beanstalk v4.4.2
Recovery: TWRP v2.6

Other Devices - Nexus 7 - OG Evo 4g
The Following User Says Thank You to R.Suave For This Useful Post: [ Click to Expand ]
 
jonahly
Old
#9  
jonahly's Avatar
Senior Member - OP
Thanks Meter 130
Posts: 635
Join Date: Oct 2012
Location: Ashland
Quote:
Originally Posted by enjoyspigeons View Post
erm.. I'm not on CM11 anymore so I can't say for sure but isn't there usually a setting in "Display" or "Buttons"? It's normally near the setting that controls the button backlight timer.

I do remember one rom where I was unable to find this setting... so if that is the case then you can try creating an Init.d script with:
Code:
#!/system/bin/sh 
echo 0 > /sys/class/leds/button-backlight/brightness; echo 0 > /sys/class/leds/button-backlight/max_brightness
I'd elaborate more on that but I tried to set it on my current rom and I couldn't get the settings to stick lol but I've used this method before many times on other roms. I like to set the button brightness to 1 while most roms set it to 2 or 3(actually any number above 2 is max brightness) and I don't think I've ever seen a way to change it permanently without using this script at boot.

Oh you could also use expose modules to turn it off but I dont think there is one that does JUST that. I'm pretty sure Gravitybox has the option in there.

Oh and I use Lux and I saw an option in there too will turn off button backlight

So yeah many options.. Id try looking thru Settings tho.

---------- Post added at 12:01 PM ---------- Previous post was at 11:27 AM ----------



It's real simple!!!

I took the back off (thats what the torx screwdriver is for) then after that unscrewed like 7 silver + screws holding the black plastic shield(?) and then used pliers to remove the little button-board. It not even really secured in there (it uses the two metal hooks to make contact with the mainboard) so you just lift it out (tho I had to use a tiny flat-head screwdriver to kinda press in the hooks in order to reinsert it) but it wasnt too bad. A lot better than paying 60 bux damn!! lol

But keep in mind... It's totally possible that the water damaged something else that could be harder to fix. Or alternatively, it could be easier. Maybe the water just rusted the metal contacts a little bit and just need a lil polishing

And I couldnt find any videos either that show the button-board clearly but this one does show taking off the back and the black plastic thing:
www.youtube dot com/watch?v=S4uspcvx3f0

I think after ten posts I'll be able to post outside links..... :P

well either way, good luck. If I can find something else to take pictures with then I could try posting some close ups of the board. But its really simple to get to.

K laters yo. Again, hope I helped!

oh and apologies to jonahly for sidetracking his thread a lil
haha man! No problem!! The more questions answered the better!
Devices
Sprint LG Optimus G
ROM: Blue Lightning
Kernel: 1.7Ghz
Lenovo ThinkPad A1000
Soft-Bricked.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes