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 on both the rooted and non-rooted Android devices.

But before you going through the steps, I want to give some suggestions:

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

Well, that’s all the suggestions I have. Let’s see the steps to do this task.

Disable Hardware Buttons on Android

Rooted and Non-Rooted Android Devices

Steps

  • angle-double-right
    Install and open “Button remapper (no root)” app.
  • angle-double-right
    Tap the Switch and then "Continue" button. Now enable the Accessibility services for the app.
  • angle-double-right
    We need to create action separately to disable each hardware button.
  • angle-double-right
    Tap "+" icon and then "Short and long press" option.
Short and long press option
  • angle-double-right
    Select Volume up from Key drop-down list and Do nothing from Action drop-down list.
Selected Volume Up and Do nothing
  • angle-double-right
    Tap + and Short and long press option again.
  • angle-double-right
    Select Volume down from Key drop-down list and Do nothing from Action drop-down list.

Both the volume buttons are disabled now.

Here is an important thing to note: the free version of this app allows you to create two actions only. If you need to create more, then you need to get premium version.

I don’t recommend disabling power button. And, note that disabling power button using this app doesn’t work on most of the devices.

I tried it and it didn’t work on my device. If you are willing to give a try on your device, then here are the steps you need to follow:

  • angle-double-right
    Tap + and Short and long press option.
  • angle-double-right
    Select Other from Key drop-down list and then choose Power option.
  • angle-double-right
    Now choose Do nothing from Action drop-down list. Tap OK.
Selected Power button and Do nothing

Hopefully, your device’s power button is disabled now.

If you want to enable hardware buttons, then just delete the action (Long press the action and then tap Delete option).

Rooted Android Devices Only

If you wonder about your device's root status, then I suggest you to check out this article.

Also, I suggest you to install this app which helps to reboot your device. You will need it while enabling power button.

Steps

  • angle-right
    Install and open ES File Explorer app.
  • angle-right
    Tap Hamburger icon and select Local.
  • angle-right
    Tap Device.
  • angle-right
    Now go to the following location: system > usr > keylayout
  • angle-right
    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.
  • angle-right
    Make sure to take a backup of the file before making any changes.
  • angle-right
    In this instance, I’m using MediaTek device. Tap mtk-kpd.kl file, choose Text and then ES Note Editor.
  • angle-right
    Now hit the Overflow menu (three vertical dots) at the top.
  • angle-right
    Tap Edit.
  • angle-right
    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

#Key 115 VOLUME_UP

#Key 114 VOLUME_DOWN

#Key 116 POWER

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

That’s it. All the hardware buttons on your Android device are now disabled.

Note:

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.


Final Thoughts

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.

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

0 Shares
Tweet
Share
+1