Has your phone's volume button gone crazy? I mean, does it keep turning the volume up or down on its own? Or did it just break inside the chassis and it keeps turning the volume down. Or even worse, your Power button is broken! All of this can be solved simply by disabling them and using a third-party app to control volume and power on/off. Well, there is a small caveat. Your phone must have root access to accomplish this particular task.
Now, if you have a rooted Android phone and want to disable the physical buttons on your device whether they are broken or active, continue.
So, in order to disable physical/hardware buttons on Android, you will need to edit the root file that enables those buttons. To access these root files, you will need a file manager that can explore root files. You can use the popular ES File Explorer or a specific root explorer like Root Explorer. Or a free root explorer like Root Browser. Here we used ES File Explorer to keep it simple.
Yes, we know that ES File Explorer has become quite annoying with some useless add-ons. We have therefore found valid alternatives.
Step 1: Open ES File Explorer and enable Root Explorer. Now press Root Explorer to open options where you need to change read and write options for root files. Press Mount R/W and in the next dialog select write (W) for /system files. So now we can modify the operating system files.
Step 2: Now under Local tab in sidebar ES tap /Device. This folder contains all root files. Now navigate to this location – system/usr/keylayout. In this folder, you will have Generic.kl and a few other files containing the keyboard and physical button operation triggers.
Now here you will have to find the perfect file that might work for you. First try the step below in Generic.kl drop. If that doesn't work, use it in other files with keywords like Mount , Volume down and Power . If you have a MediaTek device, you will only have to edit mtk-kpd.kl to file. As shown in the screenshot above. Carefully follow the step below.
Step 3: First create a backup of the particular file you are going to modify. Here, as I have a MediaTek device, I will edit mtk-kpd.kl. To create a backup, create a copy of this file and rename it adding .bk at the end as an extension.
Now open the original file and press edit. Search for keywords related to Volume_UP, Volume_Down orPower . All you have to do is add # in front of the particular line of code for the specific button. Here I inserted # (with a space after) before Volume up coded key 115.
Step 4: Save the file by pressing the back button and press Yes . Then restart the phone. The specific button on which you added a # will not work, which means it is now disabled.
Basically what you have done here is commented out the line of code for this specific button. Anything after # in that specific line will not be compiled and executed by Android. So Android is unable to run the button, so the button will not work now.
You have disabled the desired physical button. But only the button is disabled, not its function. Any other application can trigger this function (Volume down/high and screen on/off) and use it easily. You can use Pie Control or you can check out this list of apps that will let you control the volume on the screen.
Let us know if the above method to disable hardware buttons worked or not. Also, if you have any specific phone tips on this, please share. You can also ask the question in our forum.
ALSO SEE: 3 Quick Tips to Fix Delayed Notification on Android