[TIP] How to disable hardware key and enable soft key in mi5s - Xiaomi Mi 5s Guides, News, & Discussion

[TIP] How to disable hardware key and enable soft key in mi5s/mi5s plus
Mi5S and Mi5S plus has hardware key
When you play a game horizontally, the game might turn off by mistake.
You need to deactivate the hardware button to prevent this.
A necessary thing
- a rooted phone
- root explorer (you need to modify system file)
1. Go to /system/build.prop and add qemu.hw.mainkeys=0
2. Go to /system/usr/synaptics_dsx.kl and add # on last lines like
[before]
key 139 MENU VIRTUAL
key 102 HOME VIRTUAL
key 158 BACK VITRUAL
key 143 WAKEUP
[after]
#key 139 MENU VIRTUAL
#key 102 HOME VIRTUAL
#key 158 BACK VITRUAL
key 143 WAKEUP
You can make #key 143 WAKEUP and home button can be completely disabled.
(Only the power button can light the screen. not home button)
(mi5s plus doesn't has key 143 WAKEUP because mi5s plus doesn't have home button to light the screen)
3. Reboot!
You can revert these steps to enable hardware key again
and you can find hardware key light settings at Settings - Additioal Settings - Button

jpg3927 said:
[TIP] How to disable hardware key and enable soft key in mi5s/mi5s plus
Mi5S and Mi5S plus has hardware key
When you play a game horizontally, the game might turn off by mistake.
You need to deactivate the hardware button to prevent this.
A necessary thing
- a rooted phone
- root explorer (you need to modify system file)
1. Go to /system/build.prop and add qemu.hw.mainkeys=0
2. Go to /system/usr/synaptics_dsx.kl and add # on last lines like
[before]
key 139 MENU VIRTUAL
key 102 HOME VIRTUAL
key 158 BACK VITRUAL
key 143 WAKEUP
[after]
#key 139 MENU VIRTUAL
#key 102 HOME VIRTUAL
#key 158 BACK VITRUAL
key 143 WAKEUP
You can make #key 143 WAKEUP and home button can be completely disabled.
(Only the power button can light the screen. not home button)
(mi5s plus doesn't has key 143 WAKEUP because mi5s plus doesn't have home button to light the screen)
3. Reboot!
You can revert these steps to enable hardware key again
and you can find hardware key light settings at Settings - Additioal Settings - Button
Click to expand...
Click to collapse
Thank you for this. Any news from miui when they release the source? I miss Cyanogenmod

v0ne said:
Thank you for this. Any news from miui when they release the source? I miss Cyanogenmod
Click to expand...
Click to collapse
i need cyanogenmod too.. i think can get some custom rom at least 2017

thank you man.thanks alot :*

You can also do this with Magisk. I will try to upload a module.

Try this module. It works on my Mi 5S running xiaomi.eu 9.5.2.0 ROM.
What this module does is it replaces the file /system/usr/synaptics_dsx.kl, commenting out this line:
Code:
key 143 WAKEUP

wpyh said:
Try this module. It works on my Mi 5S running xiaomi.eu 9.5.2.0 ROM.
What this module does is it replaces the file /system/usr/synaptics_dsx.kl, commenting out this line:
Click to expand...
Click to collapse
This only disables waking up the screen with the home button?

Chaninoza said:
This only disables waking up the screen with the home button?
Click to expand...
Click to collapse
Yes. Should I also make modules for other functions? Like disabling all the buttons like the OP said?

wpyh said:
Yes. Should I also make modules for other functions? Like disabling all the buttons like the OP said?
Click to expand...
Click to collapse
If u want to, im just interested in the one u posted

Chaninoza said:
If u want to, im just interested in the one u posted
Click to expand...
Click to collapse
Well, someday I might submit this to the Magisk repo. Actually I don't think we need to switch the Menu and Back buttons, because they can be switched via the Settings app -> System & Device / Additional Settings -> Button and gesture shortcuts -> Button Positions / Navigation buttons, at least on Xiaomi.eu ROM it's available. I think it's also available on the original ROMs (China and Global) as well.

These modules actually implement the original post.

wpyh how I can install it on phone?

Related

[Q] Remap Hardware Buttons

Is there any way to remap the hardware buttons on the DHD? I use nolock and it works great but my volume buttons wake up my phone and sometimes when I have it in the case on my belt, the volume button gets pressed and some strange things can happen when it's not locked. I would like to remap the volume buttons so that they don't wake the phone up.
That would be no problem at all. That is, if you have full root (S-Off) so that you can write to your system partition.
If so, just edit the file: /system/usr/keylayout/spade-keypad-v0.kl
The original file has the following keymap definitions:
Code:
key 102 HOME WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 116 POWER WAKE_DROPPED
key 114 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
I've swapped the Home and the Search button because I've rather small hands
(I will write a app to redefine these buttons in the future)
I think your problem will be solved by deleting WAKE behind the volume buttons
Thanks, I'll give it a shot.
This is one thing I hate about the different manufactures; different button order.
Sent from my Desire HD
I wrote a tool to edit the keylayout map file simple and easy. Posted it here:
http://forum.xda-developers.com/showthread.php?t=850464
(it says experimental, because it is intented as an app for all Android devices. However, it is tested on the DHD and it works without any problems)
With the app you can turn off the waking up of the device, but you can also assign functions to your keys like call/endcall, media next .. you can swap the home and search button or remap the volume keys to page down/up for ereading (with a hot reboot which will be implemented later, effectuating key redefinitions can be done fast, so that it is also possible to do a temporarily remapping)

[GUIDE] Change logo2menu to logo2recents

I don't recall seeing any roms having logo2recents by default, and my current setup did not allow for it either. (I use Android Revolution + Elemental), so I decided to look for a solution.
What you do is this:
-You must have a kernel that enables logo2menu, it'll enable the logo as a button (duh )
-Navigate to /system/usr/keylayout
-Backup the synaptics-rmi-touchscreen.kl file
-Open with the text editor
-Change this line:
key 139 MENU VIRTUAL
To:
key 139 APP_SWITCH WAKE_DROPPED
Save, exit, restart.
Your logo will now load up the recents window.
To me this is much more useful than menu, since most apps have integrated the menu button into their menu bars, so I'd be wasting the use of one capacitive button. I tend to switch between apps much more often, so the quick recents window access is totally worth it.
Side benefit (an odd one that didn't exist before I changed that file). When you go into settings/display&gestures&buttons, there will be a new setting under "buttons." It'll allow you to set tap or long press for recents/menu. Weird how it didn't exist before editing the .kl file above.
Thanks to danny 92 and wednesday13 for pointers from another thread.
*Note, just figured this out. When using this method it breaks the lockscreen shortcuts. No idea how to fix that part, sorry.
great.
this is what Im looking for long time
xposed module "MenuBeGone" could also do the same
I tried changing it to:
key 102 APP_SWITCH WAKE_DROPPED
key 158 BACK
key 139 HOME
So that the setup would be similar to onscreen keys in stock android ie left button: back ; middle button: home ; right button: recent apps.
Now my home button doesn't work even after changing settings to:
key 102 HOME
key 158 BACK
key 139 APP_SWITCH WAKE_DROPPED
Also tried changing settings to:
key 102 HOME
key 158 BACK
key 139 MENU VIRTUAL
and still my home button doesn't do anything.
Had to do a restore from TWRP
I'm running android 5.1 GPE with ElementalX kernal.
Any idea how to make this work, or why the home button doesn't work even after reverting the file?
After restoring I tried just changing the Key 139 line to APP_SWITCH WAKE_DROPPED and leaving everything else as is, and it works as intended. Guess I'll just have to get used to home and recent apps being in the wrong position (and then get used to them being in the right position when I get me new phone)

[Q] is it possible to change key functions?

I was wondering if there is a way to change key functions on note 3, for example: by pressing menu key we can see recent apps instead of menu
I would be thankful if anyone can suggest a solution to do this:good::laugh:
arash2901 said:
I was wondering if there is a way to change key functions on note 3, for example: by pressing menu key we can see recent apps instead of menu
I would be thankful if anyone can suggest a solution to do this:good::laugh:
Click to expand...
Click to collapse
There are actually a couple different ways to do it...
You can used Xposed mod, with either Xposed Additions or MenuBeGone
(I've never used either of these methods...)
or, the way that I do it, manually edit the \system\usr\keylayout\Generic.kl file.
When I do it, I make the following two changes:
Change key 139 from MENU to BACK
Change key 158 from BACK to APP_SWITCH
Then I use button savior to add the menu for those things that need it...
(I'm coming from Nexus devices, so having the keys with back on the left, and app switch on the right is how I'm used to it...)
Ever wondered to use Google search ? Just saying.
Sent from my N9005
carnagecjb said:
There are actually a couple different ways to do it...
You can used Xposed mod, with either Xposed Additions or MenuBeGone
(I've never used either of these methods...)
or, the way that I do it, manually edit the \system\usr\keylayout\Generic.kl file.
When I do it, I make the following two changes:
Change key 139 from MENU to BACK
Change key 158 from BACK to APP_SWITCH
Then I use button savior to add the menu for those things that need it...
(I'm coming from Nexus devices, so having the keys with back on the left, and app switch on the right is how I'm used to it...)
Click to expand...
Click to collapse
thanks
that's helpful (kind of!)
I was able to change function of key like starting camera by pressing menu key, but still don't know how to put recent app instead of menu?
--------------------------------------------
[problem solved,found it]
thanks a million man
big help
arash2901 said:
thanks
that's helpful (kind of!)
I was able to change function of key like starting camera by pressing menu key, but still don't know how to put recent app instead of menu?
Click to expand...
Click to collapse
Quick and easy answer:
Change key 139 from MENU to APP_SWITCH

[guide] disable capacitive buttons

I have seen a bunch of posts regarding the capacitive buttons and on screen navigation buttons. Love them or hate them, this is how you can turn them off.
I will leave that up to you on how to get onscreen Navy buttons.
As for turning off the capacitive buttons this is how I did it.
1.To eneble onscreen buttons follow this thread http://forum.xda-developers.com/redm...mi-1s-t2950455
2. Download a root file explorer. Root Browser Lite --> http://goo.gl/b9ISW This is what I will use.
3.Load up Root Browser and navigate to system>usr>keylayout. We will be looking for a file called "atmel_mxt_ts.kl".
4. Select it and hit "Open as..." then "Text file" then "RB Text Editor"
5. Now we see this:
key 139 MENU
key 102 HOME
key 158 BACK
key 217 SEARCH
All you have to do is option out the keys you don't want to work with a #. So if you are like me and think the home button is fine, it will look like this.
#key 139 MENU
key 102 HOME
#key 158 BACK
key 217 SEARCH
6. When you have the ones you want optioned out just tap the little disk icon in the top right. It will ask for root rights, grant it, saved.
7. Now just reboot and DONE!
Tested on
1. One plus one a.k.a bacon(miui6, h2os, oxygen..you tell)
Sent from my bacon using Tapatalk
Hit thanks if this post helped you[emoji106]
Why on earth would anyone want to do that when there is a toggle to switch between On-Screen and Hardware Keys
PsyGik said:
Why on earth would anyone want to do that when there is a toggle to switch between On-Screen and Hardware Keys
Click to expand...
Click to collapse
OK give me a screen shot of that toggle in h2os,miui6
@Snapdragon815
Will this guide also turn off the HW key backlight?
Will it survive a reboot?
Mr.Ak said:
@Snapdragon815
Will this guide also turn off the HW key backlight?
Will it survive a reboot?
Click to expand...
Click to collapse
As you can see, i made this post 2 years ago, you can give it a try, do a backup on TWRP first, if everythinggoes as you expected, that good. If not you know how to restore.
Snapdragon815 said:
As you can see, i made this post 2 years ago, you can give it a try, do a backup on TWRP first, if everythinggoes as you expected, that good. If not you know how to restore.
Click to expand...
Click to collapse
Sorry for reviving the thread. ?
But I was hoping you atleast remember if this trick turn off HW key backlight or not.
Mr.Ak said:
Sorry for reviving the thread.
But I was hoping you atleast remember if this trick turn off HW key backlight or not.
Click to expand...
Click to collapse
Np mate,. Did it work? I don't rememberif it did or not

[Tutorial][Root]Disable Capacitive buttons and enable virtual button.

Hi,
i am previously a Moto G (2013) user.. got used to onscreen buttons like pie and gesture control.
Most of the guides available out there wont work with Le 1s.. so here it is
HTML:
do at your own risk. make sure you know about the consequences of things you are going to do.
i always recommend a back up while messing with system partition
Open this file
system>>usr>>keylayout>>ssynaptics_dsx_i2c.kl
look for below lines
Code:
key 158 BACK VIRTUAL
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
change it to (put "#" before all lines)
Code:
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
#key 580 APP_SWITCH VIRTUAL
This disables the respective action of capacitive buttons.
To enable on screen navigation button(enabling this makes your screen looks awkward) though i would prefer to use Pie controls or LMT launcher etc..
go to build.prop
search for this line
Code:
#qemu.he.mainkeys=0
change it to
Code:
qemu.he.mainkeys=0
Reboot.
PS. i am also trying to disable backlight of disabled capacitive buttons, anyone knows can help me
reversegear said:
PS. i am also trying to disable backlight of disabled capacitive buttons, anyone knows can help me
Click to expand...
Click to collapse
You can download an app called keyboard backlight controller.
naparajito said:
You can download an app called keyboard backlight controller.
Click to expand...
Click to collapse
Yeah..
Thank you
I ve come across many apps which does that.. I'm exploring system level hack
For ex modifying this file(check screenshot) disables but it gets reverted back on reboot
That will have to fixed in kernel. Easy stuff though.
reversegear said:
Hi,
i am previously a Moto G (2013) user.. got used to onscreen buttons like pie and gesture control.
Most of the guides available out there wont work with Le 1s.. so here it is
HTML:
do at your own risk. make sure you know about the consequences of things you are going to do.
i always recommend a back up while messing with system partition
Open this file
system>>usr>>keylayout>>ssynaptics_dsx_i2c.kl
look for below lines
Code:
key 158 BACK VIRTUAL
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
change it to (put "#" before all lines)
Code:
#key 158 BACK VIRTUAL
#key 172 HOME VIRTUAL
#key 580 APP_SWITCH VIRTUAL
This disables the respective action of capacitive buttons.
To enable on screen navigation button(enabling this makes your screen looks awkward) though i would prefer to use Pie controls or LMT launcher etc..
go to build.prop
search for this line
Code:
#qemu.he.mainkeys=0
change it to
Code:
qemu.he.mainkeys=0
Reboot.
PS. i am also trying to disable backlight of disabled capacitive buttons, anyone knows can help me
Click to expand...
Click to collapse
Thank you so much for this!!
I cracked my screen pretty badly. So I cannot use the capacitive buttons, and what is worse, they are activated randomly by themselves
I had previously found out how to activate the virtual buttons, which helped. But I did not know how to de-activate the capacitive buttons. This was a great help!!
However the app "Keyboard backlight controller" does not seem to work for me, it does not ask for root permission and it does not turn off the backlight.... but this is a very minor issue compared to my previous issues
While editing keys putting # , to disable capacitive buttons , it is showing a message "error occurred while saving the file, it will not be saved" what to do now I want to disable capacitive buttons
---------- Post added at 10:23 AM ---------- Previous post was at 10:14 AM ----------
Due to crack on display and improper function of capacitive buttons I want to disable that and I want to enable VIRTUAL navigation keys , while following mr.botze steps using codes while editing I mean after putting # and saving, it is showing a message " error while saving the file ,it will not be saved" what to do , anybody can help me out from this
Letvaffu said:
While editing keys putting # , to disable capacitive buttons , it is showing a message "error occurred while saving the file, it will not be saved" what to do now I want to disable capacitive buttons
---------- Post added at 10:23 AM ---------- Previous post was at 10:14 AM ----------
Due to crack on display and improper function of capacitive buttons I want to disable that and I want to enable VIRTUAL navigation keys , while following mr.botze steps using codes while editing I mean after putting # and saving, it is showing a message " error while saving the file ,it will not be saved" what to do , anybody can help me out from this
Click to expand...
Click to collapse
seems to be you dont have root previlages
reversegear said:
seems to be you dont have root previlages
Click to expand...
Click to collapse
...either that, or that you forgot to mount in R/W. What app are you using to view the files? In Root exporer, there is a button on the top that says "mount R/W" (read-write). If you don't press that you can only VIEW the files, not edit.
Is rooting needed?
botze said:
...either that, or that you forgot to mount in R/W. What app are you using to view the files? In Root exporer, there is a button on the top that says "mount R/W" (read-write). If you don't press that you can only VIEW the files, not edit.
Click to expand...
Click to collapse
I opened in edit mode but receive the error.. I have not rooted my mobile, is that the reason?

Categories

Resources