Owners of Xiaomi Redmi 8 often face the inconvenience of standard button layout โ especially if the smartphone is used with the left hand or after switching from other brands (for example, Samsung with a traditional Back-List-Home layout). Fortunately, the model supports several ways to reassign keys, including hardware settings, third-party applications and even editing system files for advanced users.
But before we make any changes, it's important to understand that not all methods are equally safe. ADB-In this article, we will discuss 4 proven methods, from the simplest to the most radical, and explain which are reversible and which require backup data.
If you have never changed Xiaomiโs system settings before, start with the first section, which describes the official methods without risking a guarantee. Experienced users will be interested in the section on manual editing of configuration files, which allows you not only to swap buttons in places, but also to add additional features (for example, double-pressing to lock the screen).
โ ๏ธ Warning: On models with a locked bootloader, some methods may not work. โ The phone. โ Version. MIUI (Click 7 times on "Core" if you see this device is locked, use only root-free methods.
1.Official method: customizing gestures and buttons in MIUI
The most secure and recommended method by Xiaomi is the use of built-in MIUI options. It does not require superuser rights and is suitable for most firmware versions (starting with MIUI 10).
To swap the navigation buttons (for example, do "Back" on the right and "Recent" on the left), follow the following steps:
- Open the settings โ System โ Gestures.
- Select the Navigation button (if you use the classic bar, not gestures).
- Slip on the location of the buttons and choose the desired option from the proposed schemes.
- Save the changes and restart the device (optional, but recommended for stability).
โ Pros of the method:
- ๐ Reversible change โ you can return the standard layout at any time.
- ๐ก๏ธ Does not affect the warranty and does not require unlocking the bootloader.
- ๐ฑ It works on all versions of Redmi 8 (including global and Chinese firmware).
โ Cons:
- โ Limited choice of schemes โ you can not create a fully custom layout.
- โ It doesnโt work if you use full-screen gestures (in this case, the navigation buttons are hidden).
2. applications for button reassignment (without root)
If built-in MIUI options arenโt enough, you can use third-party utilities, such as the Button Mapper app (available on Google Play) allowing you to reassign both software and hardware buttons (like a Bixby key if you have one on your model).
Instructions for using Button Mapper:
- Download and install the app from Google Play.
- Provide access to Special Features (in Android settings).
- Select the button you want to reassign (e.g. Recent Apps).
- Assign a new action: Back, Home, or a custom team.
- Save the profile and restart the application.
๐ก Useful tip: If buttons don't respond after a change, check if the battery optimizer blocks them. Add Button Mapper to exceptions: Settings โ Annexes โ Permits โ Auto-start.
Enable debugging over USB (for some functions)
Provide access to special opportunities
Disable battery optimization for the application
Reboot your phone after settings-->
โ ๏ธ Note: On some Xiaomi firmware, button reassignment apps may conflict with system services. If lags or spontaneous reboots appear after the changes, return the standard settings and remove the utility.
3. editing system files (root required)
For users with unlocked bootloader and superuser rights, the most flexible method is available - manual editing of the qemu.hw.mainkeys file. This method allows not only to swap buttons in places, but also to disable unnecessary ones (for example, the Google Assistant key), as well as add new functions.
๐ง Step-by-step instruction:
- Install a file manager with root support (such as Root Explorer or Solid Explorer).
- Go to /system/usr/keylayout/.
- Find Generic.kl or qwerty.kl (depending on the firmware).
- Make a backup copy of the file (copy it on the SD-map).
- Open the file in the text editor and find the strings with the button definitions: key 158 BACK key 172 HOME key 139 MENU
- Change the key to the key 158 HOME and the key 172 BACK.
- Save the file, set the rights to 644 (rw-r--r---) and restart the device.
โ ๏ธ Note: Incorrect editing of the Generic.kl file may cause the touch buttons to fail completely. If the screen does not respond to clicks after rebooting, restore the file backup via the TWRP or Fastboot.
What if the buttons stopped working after editing?
๐ Comparison of button reassignment methods:
| Method | Root is required. | Reversibility | Risk to the system | Flexibility of settings |
|---|---|---|---|---|
| Built-in MIUI settings | โ No. | โ Yes. | โ No. | โ ๏ธ Limited. |
| Button Mapper | โ No. | โ Yes. | โ ๏ธ Low. | โ Tall. |
| Editing by Generic.kl | โ Yes. | โ Yeah, backup) | โ High-pitched | โ Maximum |
| Modified firmware | โ Yes. | โ ๏ธ Partially. | โ critical | โ Full customization |
4. Installation of custom firmware with alternative layout
For the most advanced users, there is a radical way to install custom firmware (such as LineageOS or Pixel Experience), which supports flexible button settings. This method is suitable if you not only want to change the location of the keys, but also get additional features such as:
- ๐ Dynamic change of layout depending on the orientation of the screen.
- ๐ฏ Adding new gestures (e.g. swipe up to call Google Assistant).
- ๐ง Disabling hardware buttons in favor of software.
๐จ How to install custom firmware:
- Unlock bootloader through the official Mi Unlock Tool (requires a Xiaomi account binding).
- Install a custom TWRP recap for Redmi 8 (the version must match the model code, for example, olive for the global version).
- Download firmware (e.g. LineageOS 18.1) from the XDA Developers website.
- Run a full reset (Wipe โ Advanced Wipe โ Dalvik, Cache, System, Data).
- Install the firmware via TWRP and restart the device.
โ ๏ธ Attention: Installing custom firmware will void the warranty and may result in data loss:
- Create a backup through TWRP or Mi Cloud.
- Check firmware compatibility with your model (Redmi 8 is codenamed olive, Redmi 8A is olivelite).
๐ก
Custom firmware gives you maximum customization freedom, but requires technical knowledge. If you're a beginner, start with official methods or apps without root.
5. Frequent errors and their solutions
When changing the layout of the buttons, users of Xiaomi Redmi 8 often face typical problems, and here are the most common ones and how to fix them:
๐น The buttons do not respond after the change:
- ๐ Restart your device โ sometimes system services donโt apply settings right away.
- ๐ ๏ธ Check if the installed reassignment application conflicts with other utilities (for example, Nova Launcher or Tasker).
- ๐ฑ Reset your gesture settings in Settings โ System system โ Gestures โ Reset.
๐น No settings are saved in Button Mapper:
- ๐ง Give the application the right to Overlay over other windows (Settings) โ Annexes โ Button Mapper โ Permits).
- ๐ Disable battery optimization for utility.
- ๐ฒ Update the application to the latest version.
๐น After editing Generic.kl, the phone is bootlooped:
- ๐ป Connect the device to the PC and restore the original file through ADB: adb push Generic.kl /system/usr/keylayout/ adb shell chmod 644 /system/usr/keylayout/Generic.kl
- ๐ If ADB It does not work, run the stock firmware through Fastboot.
๐ก
If youโre experimenting with system files, always keep an archive of original firmware for your model on hand.
6. Alternative solutions: gestures and virtual buttons
If reassigning hardware buttons seems too complicated, consider alternative ways to manage:
- ๐ Full-screen gestures: B MIUI 12+ You can completely disable navigation buttons using swipes from the bottom edge of the screen. โ System system โ Gestures โ Full-screen gestures.
- ๐ฑ๏ธ Virtual buttons: Apps like Floating Soft Buttons add floating keys that can be moved around the screen.
- ๐ฎ Game Triggers: In Game Turbo Mode (Settings) โ Special facilities โ Game Turbo: You can assign additional buttons for convenience in games.
โ Advantages of Alternative Methods:
- ๐ No interference with system files.
- ๐ก๏ธ Compatible with any firmware.
- ๐ฏ Allows you to configure control for specific tasks (for example, simultaneously pressing two buttons for a screenshot).
โ Deficiencies:
- โ Can take up space on the screen (virtual buttons).
- โ Some gestures conflict with apps (like swiping up on Instagram).