The physical buttons on Xiaomi Mi 9 smartphones are not only a convenience, but also a potential source of random clicks. For example, the power button can be activated in your pocket, and the volume control can interfere with the game or watching video. In some cases, users want to completely deactivate one of the buttons: due to a breakage, inconvenient location or after installing custom firmware, where standard methods do not work.
Disabling buttons on the Mi 9 is not a trivial task. Unlike software functions (like turning off touch gestures), physical keys are controlled at the Android kernel level. This means that deactivating them will require either hidden system settings or developer tools. In this article, we will discuss all working methods, from simple to complex, and also discuss the possible risks and consequences.
โ ๏ธ Warning: Some methods require unlocking the bootloader and the rights of the superuser (root).This can lead to loss of warranty, malfunction of the smartphone or even "bricking" the device!
Why you might want to turn off the button on Xiaomi Mi 9
At first glance, the idea of deactivating a physical button seems strange, but there are rational reasons for this.
- ๐ง If the key is stuck, triggered arbitrarily or physically damaged, turning it off will help to avoid accidental actions (for example, rebooting or turning off the phone).
- ๐ฎ Game mode: During streaming or intense games, volume buttons can interfere by accidentally changing the sound, and turning them off will make the gameplay more comfortable.
- ๐ Castom firmware: On some informal builds (like LineageOS or Pixel Experience), buttons may conflict with new features.
- ๐ Security: Turning off the power button will make it harder for unauthorized access to the phone (for example, if you try to turn it off to bypass the lock screen).
It's important to understand that turning off a button completely is not the same as reassigning functions. In the first case, the key stops working at all, in the second case, pressing it does another thing (for example, starting the camera instead of adjusting the volume). If your goal is to reassign, you'd better use applications like Button Mapper or Tasker.
๐ก Fun Fact: On the Xiaomi Mi 9, the power button and volume control are connected to separate controllers, meaning that they can be switched off selectively without affecting other phone features.
Method 1: Disable buttons via MIUI settings (without root)
The easiest method is to use the built-in MIUI features, which unfortunately doesn't work with all buttons and is only available on some firmware versions.
- Go to Settings โ Special Options โ Physical buttons.
- Turn on the option to turn off the power button (if you have one in your version of MIUI).
- For volume buttons, select Turn off sound adjustment or reassign their functions.
โ ๏ธ Note: Xiaomi Mi 9 with firmware older MIUI 12, this section may not be there, and then you'll have to use alternative methods.
| Button | Can I turn it off via MIUI? | Alternative method |
|---|---|---|
| Nutrition | Yes (on MIUI 12+) | ADB |
| Volume (+/-) | Partially (reassignment) | Button Mapper |
| Side button (if any) | No. | Only root. |
If your MIUI version doesn't have the right options, try upgrading to the latest stable version, and sometimes the manufacturer adds new features to updates.
๐ก
Before updating MIUI, check if your model supports automatic crash recovery. Go to Settings โ About Phone โ System Update and see if there is a โRecovery after a failed updateโ option.
Method 2: Using ADB to disable buttons
Android Debug Bridge (ADB) is a tool for debugging Android devices through a computer, and you can send commands that temporarily or permanently turn off buttons, which doesn't require root, but you need to unlock the bootloader and turn on the developer mode.
Here's the step-by-step instruction:
โ๏ธ Preparation for work with ADB
- Activate Developer Mode by pressing 7 times on the Build Number in Settings โ About Phone.
- Enable USB debugging in Settings โ Additional โ For developers.
- Connect Xiaomi Mi 9 to your computer and confirm the debugging permission.
- Open the command prompt (or Terminal on Mac/Linux) and type:
adb shell
su
echo 0 > /sys/class/input/input*/enableโ ๏ธ Note: The su command requires superuser rights. If you don't have root, use an alternative method with key reassignment via Button Mapper (see next section).
To disable a particular button, you need to know its input identifier.
adb shell getevent -pIn the conclusion, find the lines with KEY_POWER, KEY_VOLUMEUP or KEY_VOLUMEDOWN โ So, for example, to turn off the power button, use the identifiers:
echo 0 > /sys/class/input/input3/enableWhere input3 is your button ID (may be different!).
What if the button does not turn off after the command?
Method 3: Applications for button reassignment (without root)
If you don't have to turn off the button completely, but just change its function (for example, make the volume button start the flashlight), you can use third-party applications.
- ๐ฑ Button Mapper allows you to reassign volume, power and even touch gestures. Works without root, but some features require ADB.
- ๐ Tasker is a powerful tool for automation, and you can create a task that blocks the buttons in certain conditions.
- ๐๏ธ MacroDroid โ a simplified alternative to Tasker with a visual macro editor.
Example of settings in Button Mapper:
- Install the app from Google Play.
- Provide access to Special Features (in Android settings).
- Select the button you want to reassign (such as Volume Up).
- Set up a new action (such as Do Nothing or Launch an app).
๐ก Important: Applications without root can't completely turn off a button -- they just intercept the button and replace it with other actions.
๐ก
Reassigning buttons through apps is the safest way, but it doesn't give you a 100% shutdown guarantee. You need root or kernel modification to completely deactivate.
Method 4: Disabling buttons through a custom core or firmware
If you use custom firmware (like LineageOS, ArrowOS, or Pixel Experience), you have more options for managing hardware buttons. Some cores (like FrancoKernel or ElementalX) allow you to disable buttons through configuration files.
Here's how to do it:
- Install a custom core with support for button settings (check the description of the kernel on the XDA Developers forum).
- Use a root-enabled file manager (such as Root Explorer or Solid Explorer).
- Go to /sys/kernel/debug/gpio or /sys/class/input (the path depends on the kernel).
- Find the file that matches your button (for example, gpio_keys or input3/enable).
- Change the value from 1 to 0 to turn off the button.
โ ๏ธ Note: Incorrect editing of files in /sys/ This may cause your phone to lose its functionality. Make a backup copy of the partition before making changes. /system through TWRP.
Example of a configuration file for the ElementalX kernel:
# Disconnect the power button
echo 0 > /sys/class/input/input3/enable
Turning off the volume button
echo 0 > /sys/class/input/input4/enableAfter the reboot, the changes will reset. To make them permanent, you need to add commands to the initialization script (for example, init.d).
Risks and Possible Problems When Turning Off Buttons
Disabling physical buttons is an interference with the system, which can have unpredictable consequences.
- ๐ Inability to turn on your phone: If you turn off the power button without an alternative way to turn on (for example, through charging or ADB), The device can become a "brick".
- ๐ง Firmware conflicts: In some custom assemblies, switching off the buttons can cause sensor or speaker failures.
- ๐ฑ Loss of warranty: Unlocking the bootloader and getting root voids Xiaomi's official warranty.
- ๐ Charging problems: On some devices, the power button is involved in the charging process, and turning it off can cause the phone to not determine the connection to the network.
๐ก Tip: Before turning off the power button, configure an alternative way to turn your phone on. For example, you can use the Double Tap to Wake function or connect the charger.
| Problem. | Reason. | Decision |
|---|---|---|
| Phone's off. | Power button disabled without alternative power switching | Connect charging โ some firmware is turned on when connecting to the network |
| The touch buttons are not working. | Conflict with drivers after changing the configuration of buttons | Restore the standard core through TWRP |
| Accidental reboots | Incorrect editing of files in /sys/ | Reset the settings to factory or stitch clean firmware |
On Xiaomi Mi 9, the power button is linked to the power management controller (PMIC). Its software shutdown may lead to the inability to charge the battery through a standard socket. USB-C. In this case, you will need to connect through EDL-mode (emergency firmware) or use of wireless charging (if supported).