The power button on Xiaomi smartphones is not just a way to turn the device on or off. MIUI It's got dozens of hidden features that 90 percent of users don't even know about: double tap to start the camera, hold on to the voice assistant, triple tap for emergency. SOS β And that's just the tip of the iceberg, but what if you don't want to use the standard combinations, you want to, for example, double-click a flashlight or lock the screen with a single touch?
In this article, we will discuss all possible ways to reassign the power button to Xiaomi, from built-in tools. MIUI 14/15 down-to-the-cloak ADB And third-party apps. You'll learn how to do this:
- π Change the default action (single/double click, retention)
- π± Set up power button gestures for quick access to apps
- βοΈ Use it. ADB Extended functions (including prohibited functions) MIUI)
- β οΈ Bypass system limitations without root rights
- π§ Restore the standard settings if something goes wrong
Important: Not all methods work on customized firmware (like Pixel Experience or LineageOS). MIUI, There are additional options available for devices with unlocked bootloader, which we will also consider.
MIUI Standard Settings: What You Can Change Without Root
Starting with MIUI 12, Xiaomi added built-in tools to reassign buttons, but hid them deep in the menu:
- Open Settings β System β Gestures and buttons.
- Select the Power button (on some models β Physical buttons).
- Here you will see the available options: π Double tap: Launch the camera, flashlight or application (select from the list). π Retention: Voice Assistant (Google Assistant or Xiao) AI), switch-on. π Triple press: SOS User action (not available on all models).
Nana POCO F5, Redmi Note 12 and new flagships (Xiaomi 13 Ultra, 14 Pro) in this menu there is an additional Action item when blocking:
- π΅ Turn off the screen with one tap (without delay).
- π Block the device with a fingerprint + power-button.
- π± Run an app when you hold on (like Google Pay for contactless payment).
Limitation: In standard settings, you canβt reassign a single click (itβs always responsible for locking/unlocking) and you canβt link system functions like turning on Mode on an airplane or Do Not Disturb β this will require you to do it. ADB.
π‘
If your menu does not have the "Power button" item, update it. MIUI Check the latest version or check the model of the device on some budget smartphones (e.g. Redmi). A2) function is missing.
Advanced settings through ADB: How to circumvent restrictions MIUI
For those who donβt have the standard options, thereβs a way to reassign any action of the power button β including a single click β through the power button. ADB (Android Debug Bridge β This method works on all Xiaomi devices with an unlocked bootloader and does not require root rights.
You'll need:
- π₯οΈ Computer with installed ADB Tools.
- π± Included Debugging by USB on a smartphone (Settings) β The phone. β Version. MIUI β Press 7 times, then return to Settings β Additionally. β For developers).
- π USB-cable (preferably original).
Instructions:
- Connect your smartphone to your PC and execute the command: Adb devices Make sure that the device is determined (should appear its serial number).
- Enter the command to view current button assignments: adb shell settings list secure | Grep key Here we are interested in parameters power_key_long_press (retention) and power_key_double_press (double-click).
- To reassign the power button to start Google Assistant, use: adb shell settings put secure power_key_long_press 1 Other meanings: 0 β without action. 1 β Google Assistant. 2 β Xiao AI (China only). 3 β switch off.
adb shell settings put secure power_key_double_press 2Where 2 is the action code for the flashlight. For the full list of codes, see the table below.
| Code of operation | Function | Works for MIUI. |
|---|---|---|
| 0 | No action. | β All versions. |
| 1 | Camera launch | β All versions. |
| 2 | Lantern | β Starting with MIUI 12 |
| 3 | Voice assistant | β Depends on the region. |
| 22 | SOS (flash-call) | β οΈ Only in some models |
How to reassign a single click of the power button?
After reassignment through ADB Changes will persist even after the reboot, but will reset to standard when updated MIUI. To get it all back, use it:
adb shell settings delete secure power_key_long_press
adb shell settings delete secure power_key_double_pressπ‘
ADB It allows you to reassign only those actions that are already laid down in the MIUI. For example, you wonβt be able to tie the power button to Spotifyβs launch or mobile data enabled β you need third-party apps to do this.
Third-party apps: Button Mapper, Tasker and alternatives
If the built-in options and ADB Not enough, third-party utilities are coming to the rescue:
- ποΈ Button Mapper β allows you to reassign any physical buttons (including power and volume control) to run applications, system functions or macros.
- π€ Tasker + AutoInput plugin β to create complex scenarios (e.g., βpower button retentionβ + shaking = set up").
- π SecondScreen β specializes in button gestures (e.g., double clicking to switch between applications).
Letβs look at the Button Mapper:
- Download the app from Google Play.
- Grant permission for Special Opportunities (Settings) β Special opportunities β Button Mapper).
- Select the Power button and set up actions: π Single Click: Screen locking (alternative to standard behavior). π Double Click: Launch Google Keep or another app. π Retention: on/off mode in the aircraft.
Save the settings and test.
The benefits of Button Mapper are:
- β It works without root.
- β Supports macros (e.g., βpower clickβ) + volume = screenshot").
- β System functions that are not available through ADB.
Disadvantages:
- β οΈ On some Xiaomi models (e.g. Redmi Note 10 Pro) the app may conflict with the MIUI, delaying the blocking.
- β οΈ After updating MIUI settings may reset.
Disable battery optimization for the application|Provide all requested permits|Test the settings in safe mode|Create a backup of current button assignments-->
Reassigning the power button on custom firmware (TWRP, root)
If your Xiaomi is running custom firmware (Pixel Experience, LineageOS, ArrowOS), the ability to reassign buttons is expanded significantly. Here you can change any action, including a single click, without restrictions. MIUI.
Ways:
- Through build.prop: Open the file /system/build.prop any text editor with root rights: ro.config.vc_keyboard_power_longpress=1 # 1 β Google Assistant, 0 β without action ro.config.vc_keyboard_power_doublepress=2 # 2 β Flashlight Save the file and restart the device.
- Xposed Framework (for Android) 7-10): Install the Xposed Additions module. In the module settings, select the Power Button and assign the desired actions.
Magisk
- Install the Button Mapper Magisk Module.
- Configure the buttons through its interface (similar to the application of the same name).
On custom firmware, you can assign a power button to run any application or system function, including those that are locked in the MIUI (For example, reboot to recovery or enable debugging USB).
π‘
Before editing build.prop, make sure to back it up! a syntax error can lead to bootloop (locked device turn on).
Frequent problems and their solutions
Reassigning the power button is a delicate process, and it doesn't always go smoothly. Here are the most common problems and ways to fix them:
β οΈ Note: If, after changes, ADB Button Mapper smartphone stopped responding to the power button, connect it to charging and hold the power button + Volume up for 10 seconds for forced reboot.
| Problem. | Reason. | Decision |
|---|---|---|
| The power button does not respond to the pressing | Conflict with MIUI after modification ADB | Adb shell settings delete secure power_key_long_press |
| Double clicks are triggered by accident | Low delay between pressings | Increase the delay in Button Mapper (Double Press Delay setting) |
| No reassignment on custom firmware works | There is no support in the core. | Install the Button Mapper Magisk Module |
| The smartphone is spontaneously turned off | Reassigned single click to shut down | Return the standard settings through ADB or TWRP |
If you use Button Mapper and notice that the smartphone has become slower to lock, try:
- π Disable battery optimization for the application.
- π Reduce the number of assigned actions (e.g., leave only a double click).
- π Switch to switch to ADB-basic-function.
β οΈ Attention: On devices with MIUI Global Stable Some Teams ADB If you see a not allowed error after you enter the command, try using the Button Mapper or unlock the bootloader.
Reassign the power button on Xiaomi tablets (Pad) 5/6)
On Xiaomi Pad 5, Pad 6 and Pad 6 Pro, the power button behaves differently than on smartphones.
- π± Locking/unlocking the screen.
- π Calling Google Assistant (holding).
- π· Camera Launch (Double Click if enabled in Settings).
Features of reassignment on tablets:
- MIUI for tablets has a separate button settings menu: Settings β Display. β Buttons and gestures.
- On the Pad 6 Pro, triple-click reassignment is available (for example, to run Xiaomi Notes).
- Through ADB You can assign a power button to enable Read Mode or Dark Theme: adb shell settings put secure power_key_long_press 23 where 23 β read-code.
Limitation: On Xiaomi tablets, you can't reassign a single click of the power button even with root rights - this is locked at the kernel level.Alternative: use gestures on the lock screen.
Security: What Cannot Be Reassigned and Why
Not all experiments with the power button are harmless, but some changes can:
- π¨ Lead to loss of warranty (if you use unofficial firmware or root).
- π¨ Cause software failures (for example, inability to unlock the device).
- π¨ Disrupt system services (for example, disable) SOS-challenge).
What can't be done:
- β Reassign a single click to turn off the device β the risk of accidental shutdown.
- β Assign a reset or login to recovery to the power button without emergency.
- β Use unverified ADB-team from dubious sources.
If you still encounter a problem (for example, the smartphone does not respond to the power button), try:
- Connect the device to charging and hold the power button + volume up to 15 seconds (forced reboot).
- If the screen is not turned on, connect your smartphone to your PC and do: adb reboot recovery
- In extreme cases, use the Mi Flash Tool to flash the device.
π‘
Before experimenting with the power button, back up your data through Settings β Additionally. β Backup and reset, which will keep you from losing important information when you crash.