Typically Android devices have three hardware buttons (volume buttons (also called as Volume Rocker) and a power button).
If you want to disable those hardware buttons for some reason, then you can do it. All you need to have is a rooted Android device (wonder about your device root status, click here for the steps to find it out).
If you have a rooted one, then we are good to go.
But before going through the steps, I want to give some suggestions:
- Don’t disable power button. Yes, don’t do it because it is risky. Disabling volume buttons are not risky. But the power button is. So, unless you have a good reason to disable power button, don’t do it.
- If you have decided to disable power button, check out and implement the steps in this article on your device to wake up your device without power button.
- Install an app that helps to reboot the device. You will need it while enabling power button.
Well, that’s all the suggestions I have. Let’s see the steps to do this task.
Disable Hardware Buttons on Android
- Install and open ES File Explorer app.
- Tap Hamburger icon and select Local.
- Tap Device.
- Now go to the following location:
- In this instance, I’m using MediaTek device. Tap mtk-kpd.kl file, choose Text and then ES Note Editor.
- Now hit the Overflow menu (three vertical dots) at the top.
- Tap Edit.
- Find the following lines of code:
- Now put the pound sign (#) before all the above code (see below screenshot):
- Tap Back key and tap "Yes" on the confirmation message.
- Restart your mobile to apply the changes you have made.
system > usr > keylayout
Here is an important thing to note:
If you have a MediaTek device, you need to edit the mtk-kpd.kl file. If you have a non-MediaTek device, then you need to edit Generic.kl file. If you wonder your device is MediaTek or not, then check out this guide.
But before making any changes to the file, take a backup of the file.
Key 115 VOLUME_UP
Key 114 VOLUME_DOWN
Key 116 POWER
#Key 115 VOLUME_UP
#Key 114 VOLUME_DOWN
#Key 116 POWER
That’s it. All the hardware buttons on your Android device are now disabled.
If editing the above-mentioned files doesn’t disable buttons, then go ahead and edit the other files in the “keylayout” folder which have the above-mentioned lines of code. Make sure to take a backup of the file before making any changes.
If you want to enable all the hardware keys back, then just remove # from all the code above, save the file and reboot your device.
If you have disabled the power button, then you can’t restart your device using power off menu. So just use the restart app (that I’ve mentioned earlier to install) to do this reboot work.
I hope this post is useful to you. If you find the information in this post useful, share this post with your friends.