Disable (in software) Nexus S Power Button My Nexus S has a broken power button that some days works fine, some days doesn't work at all, but most days just acts up and will randomly turn my phone on, even when it's sitting on the table.

I'm running a CyanogenMod 10.1 nightly on it. Through ButtonRemapper, I've mapped the soft search button to act as a power button, and enabled the volume buttons to turn the phone on. Thus, I have no need to use the power button anymore, and it is just annoying.

Is there a way I can disable (without hardware modifications) the power button? ButtonRemapper doesn't have in its options the ability to change it, and I've had no luck trying to modify the keymap files.

Any help is appreciated!
Xposed Additions Method

For this, you will require root:


Install the latest version of BusyBox. If you are having trouble with that installer, you can use an alternate BusyBox installer like BusyBox Installer.
Install the latest version of Xposed Installer.
Install the Xposed Additions module (Play Store)
Activate the module via Xposed Installer > Modules > [tick the box next to Xposed Additions].
Install the framework via Xposed Installer > Framework > Install/Update.
Reboot. A soft reboot is sufficient, but if it doesn't work, try a full reboot.
Xposed Additions > Buttons > Add New Button > (press the hardware button(s) you want to reconfigure, then tap OK].
Now, under Xposed Additions > Buttons, the buttons you have added will be there. Tap on the Power entry in the list. From here, you can configure the button to have no action on both screen on, screen off, and lock screen (if necessary). You can change each Click and Long Press action to do nothing.


Note: This will only prevent the power button's action while Android is running. This will not affect your button configuration while your device is (a) powered off, (b) in bootloader/download mode, or (c) recovery mode.

IMPORTANT: Make sure you have an alternate power button configured, or you may have no way to turn your screen on without a reboot! If this happens, reboot the phone, then add an alternate button to power on your device.