[Q] Remapping of volume down key to power button

NikolaMK

Member
Dec 24, 2010
25
19
0
Hi:)
I have a Nexus 5 and recently my power button started behaving all weird. I figured out that it's probably worn out and started registering presses at random times, sometimes rebooting the phone.
My solution was to use the double tap to wake kernel, but on lollipop it seems to drain a LOT of battery.
The next thing I thought of, was remapping the buttons, so that I can switch the function and use my volume down key as a power button, and the power button as a volume down button.
Went into system/usr/keylayout/ and edited the General.kl and replaced the 114 and 116 button codes, but it didn't seem to have any effect. Then I went into the other files and managed to get the volume down and power button not to work :) I did a restore, and everything is back to normal, but I couldn't achieve my goal :(
Also tried Button Remapper, but it didn't do anything.
Does anyone know how this can be achieved on Lollipop?

Thanks:)
 

Elluel

Senior Member
Jan 14, 2014
5,168
3,056
0
23
えうれる
Some ROM provide a volume rocker wake function.

Or if you're talking about to turn the phone on while its completely shut off or while in bootloader, then it'll never happen.
 

NikolaMK

Member
Dec 24, 2010
25
19
0
Some ROM provide a volume rocker wake function.

Or if you're talking about to turn the phone on while its completely shut off or while in bootloader, then it'll never happen.
OK about the Volume rocker wake, but I would need it to also put the phone to sleep, and also I want the power button to act as volume up/down(whatever).
Don't need it when the phone is completely off, just while it's on. Basically I'm asking which values to edit in order to completely swap the power and volume down buttons.
 

NikolaMK

Member
Dec 24, 2010
25
19
0
Hey thanks for the solutions suggested, but I'm looking for a mod on stock Lollipop, rooted. Tried to modify the files in system/usr/keylayout but I always end up breaking the volume buttons and they do not wake up the device...Any other solutions?