How to turn off the button on Xiaomi Mi 9: all the ways and risks

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.

๐Ÿ“Š Why do you want to turn off the button on Xiaomi Mi 9?
The button is broken.
Playing games.
It's for custom firmware.
Other

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.

  1. Go to Settings โ†’ Special Options โ†’ Physical buttons.
  2. Turn on the option to turn off the power button (if you have one in your version of MIUI).
  3. 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.

ButtonCan I turn it off via MIUI?Alternative method
NutritionYes (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

Done: 0 / 4
  1. Activate Developer Mode by pressing 7 times on the Build Number in Settings โ†’ About Phone.
  2. Enable USB debugging in Settings โ†’ Additional โ†’ For developers.
  3. Connect Xiaomi Mi 9 to your computer and confirm the debugging permission.
  4. 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 -p

In 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/enable

Where input3 is your button ID (may be different!).

What if the button does not turn off after the command?
Check if you have the correct identifier. Sometimes the power and volume buttons have different input numbers. Also make sure you have root rights (the su command must run without errors). If root is missing, try the method with a Button Mapper or custom core.

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:

  1. Install the app from Google Play.
  2. Provide access to Special Features (in Android settings).
  3. Select the button you want to reassign (such as Volume Up).
  4. 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:

  1. Install a custom core with support for button settings (check the description of the kernel on the XDA Developers forum).
  2. Use a root-enabled file manager (such as Root Explorer or Solid Explorer).
  3. Go to /sys/kernel/debug/gpio or /sys/class/input (the path depends on the kernel).
  4. Find the file that matches your button (for example, gpio_keys or input3/enable).
  5. 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/enable

After 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 switchingConnect 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 buttonsRestore the standard core through TWRP
Accidental rebootsIncorrect 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).

FAQ: Frequent questions about disabling buttons on Xiaomi Mi 9

Can I turn off the power button without root?
Partially. You can temporarily block it from working through ADB, but you need a root or custom core to permanently shut it down, and some versions of MIUI also allow you to turn off the power button in special features settings.
What if the phone doesnโ€™t turn on after the button is turned off?
Connect the charger and wait 10-15 minutes. If the phone doesn't respond, try pressing the power button + increasing the volume by 10-20 seconds for a forced reboot. In extreme cases, you will need firmware via Fastboot or EDL.
How to return the button to work after disconnection?
If you have disabled the button through ADB, simply follow the command echo 1 > /sys/class/input/inputX/enable (where X is the button ID). If you have used a custom core, restore the standard or edit the configuration files back.
Will your fingerprint work if you turn off the power button?
On the Xiaomi Mi 9, the fingerprint scanner is built into the screen, so it doesnโ€™t work with the power button. However, if you use a model with a physical scanner on the back (such as the Mi 9 SE), disabling the button can also block the scanner.
Can I turn off only one of the volume buttons?
Yes. You can turn off or reassign each button separately through ADB or Button Mapper, for example, leave the volume button running, and block the volume button from increasing.