My nexus 5's power button became unresponsive and when pressed, wouldn't lock the screen but instead bring up the power down menu. It then turned off and when i tried to turn it back on, it would go into the boot animation, then turn off again, then turn back on and do the boot animation then turn off. I am able to get to recovery but as soon as i get there, it selects the first action. I'm assuming this could be a hardware problem associated with the power button.
The phone is currently connected to the charger, but the Google screen just flashes on and then off. Any advice is appreciated greatly, as i would like my phone to be usable soon.
EDIT: Forgot to mention my phone is unlocked and rooted, but running stock AOSP with Xposed Framework