How to Disable Hardware Buttons on Android

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:
  • 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.

  • ​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:
  • Key 115 VOLUME_UP

    Key 114 VOLUME_DOWN

    Key 116 POWER

    mtk-kpd.kl file containing hardware buttons code
  • ​Now put the pound sign (#) before all the above code (see below screenshot):
  • #Key 115 VOLUME_UP

    #Key 114 VOLUME_DOWN

    #Key 116 POWER

    Putting pound sign before hardware buttons code
  • Tap Back key and tap "Yes" on the confirmation message.
  • Restart your mobile to apply the changes you have made.

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.

In the case of volume buttons, we disabled its functionality. But, not the volume functionality from the entire device. The thing is that you can still use other app to control your device volume.

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.

Also see:​

Share Your Thoughts