Enable on-screen buttons - Xiaomi Redmi 1S

As I don't like the default button layout, I enabled the on-screen buttons and disabled the hardware buttons.
In case someone wants to do that, too, I thought I just post the instructions here:
1) Enable on-screen buttons
Edit the file /system/build.prop and add the following line:
qemu.hw.mainkeys=0
2) Disable hardware buttons
Edit the file /system/usr/keylayout/ft5x06.kl and comment out the following lines:
#key 139 MENU VIRTUAL
#key 102 HOME VIRTUAL
#key 158 BACK VIRTUAL
#key 217 SEARCH VIRTUAL
3) Reboot
Tested with CM11. Not sure if this would work on MIUI.
Thanks @chris5s and several other forum users. I know that there are a couple of similar posts for other phones. But I still hope this is helpful so that Redmi 1S users don't have to look in another place.

Related

[DEV][HOWTO] How to decompile kcm.bin to remap keys properly.

Someone please explain how to properly decompile the kcm.bin so that it can be edited and recompiled. There are quite a few of us who would like to remap certain hardware buttons (mainly custom user keys) but just using the files from (this thread) leaves us with some broken keys, the "?" key mainly... but some would also like to tweak this layout and don't have a proper tutorial. I will gladly donate a minimum of $10USD to the first person who properly explains the process for both *nix and windows environments.
This is another approach.
(If you have already read this and it is not the way you want it, I am sorry)
According to http://forum.xda-developers.com/showthread.php?t=1285244&page=3
In short:
# Remount
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# fetch Keylayout
adb pull /system/usr/keychars/vision-keypad-wwe.kcm.bin /tmp/vision-keypad-wwe.kcm.bin
# edit Keylayout according to Thread above with a hex editor
For example A 2 a A ! ! that represents:
A: Scancode
2: Does not matter
a: Letter when button connected to the keycode is pushed
A: SHIFT + button connected to the keycode is pushed
!: ALT + button connected to the keycode is pushed
!: SHIFT + ALT + button connected to the keycode is pushed
(for me ALT = FN)
# push it back
adb push /tmp/vision-keypad-wwe.kcm.bin /system/usr/keychars/vision-keypad-wwe.kcm.bin
The first line in every row is the constant value of the keycode.
For example: http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_A
For Button A it is: 29 in decimal, 1D in hex.
With this approach you can change every key, but only the printable characters.
Search button will not work, as it is implemented in another way...
ok, not sure if I missed something, but specifically I need to modify the ? key and the 3 user assignable keys on the g2/dz keyboard... I don't see in the hex editor any line that starts with the ? symbol then has a number and two more chars/symbols after the number (ie: A 2 a A ! ! )
when I load keynumber tracker app the ? key reports "214" the user assignable keys report 183, 184 and 185... I'm just not sure what to do with those numbers, or how they help me modify anything...
I guess I just don't understand what I'm doing...
Ok, so I noticed in hex editor that the only difference between the modded kcm.bin and the stock one where my ? key works (besides the remapped keys) was the last 64 blocks of hex so I copy /pasted that part to the modded kcm.bin then saved and pushed... Now it's working, thanks so much, will PM you momentarily to get your paypal addy. Sooooo happy!!!
Edited w/ a cold press a CNC and a water jet @ 30,000PSI.

Ans for how to remap menu &home key

Tutorial in changing menu key to home key and recent app functionality on long press
Applies for all Samsung galaxy s and note s
1.First install solid explorer v1.4.3a only in this v u can edit system file only in rooted d
2.Then go to system/usr/keylayout/gpio-keys.kl .. In this change key function
Key 172 HOME to > key 172 MENU
3.Then go to system/use/key layout/sec_touchkey.kl...In this change keyfunction
Key 139 MENU to > key 139 HOME
..Then reboot now u find the menu and home key functions are interchanged u can do this in any ROM or in stock ROM
I tried a day and found it thanks

[Guide/Mod] Disable Power Button in Jellybean 4.1.2

Disable Power Button Mod
The flashable mod will ONLY work on the E4GT JB 4.1.2 build please do not use this mod on any other build or phone.
Due to the high failure rate of the power button on our older phones, this is a hardware key mod that will disable the power button on our E4GT phones in JB. This only cuts back on the random power button presses of a failing button while the JB rom is booted. I don't think it disables the long press of the power button to do a soft reset as this is not a ROM feature but a hardware feature built into the phone.
Flash this mod in recovery mode.
Please make certain you have a current backup already saved to your phone.
I will not be responsible if your rom does not boot or has any other issues.
___________________________
Brief guide:
For our builds this is a simple edit of two files.
system/usr/keylayout/Generic.kl
system/usr/keylayout/gpio-keys.kl
Place a comment code (#) in front of any line that is still active with the keyword POWER
Example gpio-keys.kl edit
Before:
Code:
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
[COLOR="Blue"]key 116 POWER WAKE[/COLOR]
key 172 HOME WAKE
After:
Code:
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
[COLOR="Red"]# key 116 POWER WAKE[/COLOR]
key 172 HOME WAKE
Note: This principle should work on other phones & builds but your key files may be slightly different. If you successfully edit your phone & build, please share your experience here with others.

[Guide] Disable hard navigation keys (not onscreen 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/redmi-1s/themes-apps/how-to-onscreen-buttons-redmi-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 "ft5x06.kl".
4. Select it and hit "Open as..." then "Text file" then "RB Text Editor"
5. Now we see this:
key 139VIRTUAL
key 158 VIRTUAL
key 102 HOME
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 139VIRTUAL
#key 158 VIRTUAL
key 102 HOME
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. Redmi 1s(miui, Validus, Pa, mokee,cm11 ROMs)
Sent from my HM 1S using Tapatalk
Hit thanks if this post helped you[emoji106]
Nice guide, works with CM11 too, only the file for editing is different:
/system/usr/keylayout/ft5x06.kl
Don't remember to backup the original file before editing!
philip_petev said:
Nice guide, works with CM11 too, only the file for editing is different:
/system/usr/keylayout/ft5x06.kl
Don't remember to backup the original file before editing!
Click to expand...
Click to collapse
Thanks bro OP updated....:thumbup:
Sent from my HM 1S using Tapatalk
Thanks
It worked awesome on Mokee ROM history version
thanks for useful tips. its a pain operating non backlit capacitive button

How to remap Hardware keys in treble roms?

any other options other than Gravitybox?
thanks in advance
[Requires root]
Option A:
Go to system > usr > Keylayout and edit these lines
KEY 139 MENU
KEY 158 BACK
Click to expand...
Click to collapse
swap MENU and BACK numbers:
KEY 158 MENU
KEY 139 BACK
Click to expand...
Click to collapse
Option B:
Go to Vendor > USR > KEYLAYOUT
Select ft5435_ts.kl (or similar name) and edit these lines:
key 158 BACK VIRTUAL
key 139 APP_SWITCH VIRTUAL
key 172 HOME VIRTUAL
key 217 SEARCH VIRTUAL
key 143 WAKEUP
Click to expand...
Click to collapse
swap back and app_switch number:
key 139 BACK VIRTUAL
key 158 APP_SWITCH VIRTUAL
key 172 HOME VIRTUAL
key 217 SEARCH VIRTUAL
key 143 WAKEUP
Click to expand...
Click to collapse
the numbers are an example, they can be different
Button Mapper: https://play.google.com/store/apps/details?id=flar2.homebutton

Categories

Resources