Completely disable Nexus 5 Power Button and Remap to Volume Button I have a 1.5 year old Nexus 5 and its power button is somehow broken from the inside. The thing goes in a reboot loop whenever I either try to turn the phone on or put it on charging. Upon giving it a good smack, it somehow works and boots but it's only good for about a few minutes as whenever even a bit of pressure is applied on the power button, it goes in the reboot loop again.

So, I've been trying to completely remap the power button to Vol UP button and somehow completely disable that broke power button so the OS doesn't even consider its inputs. Here are some helpful links I came across, except the issue is the inability to push the changed keymap files back to /system without root. 


https://nattster.wordpress.com/2015/09/22/use-volume-button-to-wake-up-nexus-5/
Remapping power and volume keys


I tried installing twrp but by doing going to bootloader via adb but then after I flash twrp and try to switch to newly installed recovery, the broke power button takes over and puts it into a reboot loop. If I try to get to recovery via adb, it goes to stock recovery as it is somehow overwriting twrp during the boot process.

I wouldn't mind getting the stock Android source code and somehow disabling all those mappings and reflash the new ROM on the device but I have no idea what files I need to go to, for disabling the power button.

So, I'm kinda stuck right now. Any help or pointers would be appreciated! Thank you!
As a hardware solution,   


  Your power button is not broken, but getting stuck from residue or soft rubbers.


You can massage the key to help remove any sticky parts from the key and to help rejuvenate the rubber bounce.


Press the power button in reasonably hard and hold it in for a few seconds, then slowly decrease the pressure until you have removed your finger.
( This can help to crush any dust or move any residue out of the buttons path )  
Press the button in slowly until you feel it just make contact &amp; quickly release it..
( Repeatedly doing this will help to dry any sticky residue from something like a fizzy drink ) 
Blow air into the button, press a few times and blow again ! 
( This can help to remove any sand or grit that might be holding the button down )   
Massage the button, press the button in slowly and then with moderate pressure, push up on the power button ( applying the most pressure on the top part of the button )  and slowly keeping moderate pressure, drag your finger ( or roll it ) to apply more pressure on the bottom of the button ... 


Repeatedly Roll your finger ( or slide it up and down ) to distribute the pressure throughout the entire button... You will be Rocking the button while maintaining moderate pressure.

( This can help to rejuvenate the rubber that returns the button back to it's position )  

I believe the issue can be fixed by massaging the button.