[MOD] [ROOT] Enable On-Screen Keys and Disable H/W Keys

prathameshsd

Senior Member
Feb 7, 2013
318
1,213
133
This mod enables an on-screen navigation bar like Moto/Nexus/Pixel devices and disables the hardware navigation keys.

Tested and Working On
  • LineageOS 14.1
  • MIUI Pro ROM

Not Working On
  • Official MIUI8 & MIUI9 ROM
  • Xiaomi.EU ROM
  • Mi-Globe ROM

Requirements
  • Unlocked bootloader with TWRP installed : Guide
  • Root access - SuperUser or Magisk : Guide

Enabling on-screen navigation bar
Note: Some custom ROMs have a toggle to enable on-screen navigation bar in Settings. ( Eg. MIUI9 Pro)
  • Boot into TWRP. Backup > Select "system" partition (recommended)
  • Install any file manager app that supports root access such as Solid Explorer, MiXplorer
  • Open the app and grant root permissions. Go to the root folder > system > build.prop
  • Open it with the text editor and scroll to the bottom. Leave a line and enter the following text on the next line.
    Code:
    qemu.hw.mainkeys=0
  • Save the file and reboot your phone. You should see an on-screen navigation bar on your screen.

Disabling hardware navigation keys
Note: Some custom ROMs have a toggle to disable the H/W key light in the Settings.
  • To disable the function of the H/W keys, boot into TWRP, flash Disable_HWKeys.zip and reboot
  • If you want to re-enable H/W keys, flash Enable_HWKeys.zip and reboot.
  • If you messed up somewhere, restore the "system" backup from TWRP.
 

Attachments

Last edited:

paq1170

Senior Member
Jun 12, 2015
142
32
0
Abuja
Tested and working on MIUI 10 Global. Awesome.
Dev should update on what OS its working on.

It would be lovely if it could be customized further by adding extra keys since the screen is wide enough. If there is a way pls reveal
 
Last edited:
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone