[Guide]How to disable the home key button at screen off [Root Required] - XPERIA X10 General

Here is a little guide on how to disable the screen from turning on in your pocket by accidentally clicking the home key. Which can set off unwanted calls/txts/homescreen changes/etc.
Perhaps there is an easier way, but this works for me, and sharing is caring
There I obtain a copy of Root Explorer, its easy for me to do. For those of you who are too cheap, scroll a bit further down this post, both methods require, obviously, root access:
I have no idea if there are free programs with the same usabilities as root explorer
Method with Root Explorer (or similar?)
Open Root Explorer
Go to /system/usr/keylayout
Click on the button ‘Mount R/W’ (upper right)
Locate, press and hold es209ra_keypad.kl file
Select ‘open in text editor’
Find this line:
key 102 HOME WAKE_DROPPED
Remove the WAKE_DROPPED, so that the end result is:
key 102 HOME
Save the file
Reboot
Done
Method without Root Explorer
You need a little understanding of adb.exe
Typ in cmd.exe:
adb pull C:\es209ra_keypad.kl /system/usr/keylayout/
Go to C:\ and open es209ra_keypad.kl in wordpad
Change:
key 102 HOME WAKE_DROPPED
to:
key 102 HOME
Save the file
Typ in cmd.exe:
adb shell
#su
#mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system
(ONLY if you got an error, while trying to remount)
[*]Typ in adb shell:
[*]#cat /proc/mounts
[*]and search for 'system' in the mount list to check correct path for ‘/dev/block/mtdblock2 /system’. If it differs, alter the above line.
Typ in adb shell:
#exit
adb push C:\es209ra_keypad.kl /system/usr/keylayout/
Reboot your phone
This should work... if it doesn't, just leave a comment, and I'll probably try to help you.. that is, if I'm in a good mood..
I attached my es209ra_keypad.kl, just for reference purposes I guess, or for people who are too shy to pull stuff from their phone.

thanks for this!! i have been after a few key tweaks for a while!! don't suppose you have any idea how to make the back key "kill" foreground app!!
2.1 optimised 2.1.67

good idea
thanks for sharing this

[Q] Disable wakeup using home button? [SOLVED]
Use Search next time

prewed said:
[Q] Disable wakeup using home button? [SOLVED]
Use Search next time
Click to expand...
Click to collapse
Aren't you just mister friendly? Thank god we got guys like you on this forum, otherwise this place would be fun.
I did use search, so unfortunately for you. I could not find a correct guide explaining step by step how to do it WITHOUT root explorer
xx
[email protected] said:
thanks for this!! i have been after a few key tweaks for a while!! don't suppose you have any idea how to make the back key "kill" foreground app!!
2.1 optimised 2.1.67
Click to expand...
Click to collapse
no problem, ill try to find out if it is possible in 2.1, i think its in the framework though. It's already embedded in 2.2 and 2.3 (long press back), so you can try a custom ROM ?

Related

Disable Camera Button???

I know most of you love the camera button, but for my big hands I am frequently hitting it by accident.
Does anyone know of a way to disable it?
Thanks
So nobody knows a way to disable it????
Have not heard from anyone, so is it impossible?
Yes it should be possible. You most likely need root.
Edit the file.
/system/usr/keylayout/qwerty.kl
Put a # infront of the line with "key 212 CAMERA"
#key 212 CAMERA
EStrongs File Explorer should allow you to make the edit. If that doesn't work, someone should be able to explain how to do it with ADB.
I have not tried this yet, but it should set you on the correct path.
Thanks...... so without a root no way?
Pops_G said:
Yes it should be possible. You most likely need root.
Put a # infront of the line with "key 212 CAMERA"
#key 212 CAMERA
Click to expand...
Click to collapse
Bump...
Id like to know how to do this too and the above didnt work for me. Im rooted and made the edit, however it didnt change anything.
Even deleted 212 CAMERA, still no go.
Hey- I got this to work.
In the system/usr/keylayout directory, s3c-keypad.kl is the file you want. If you have a rooted phone, and spent the $4 for root explorer (i recommend), then it'll ask for superuser as it loads, and you can edit it and save backups and everything- very nice. Anyway, back to root explorer- hold down the file, and scroll down to Open in Text Editor. Once inside, use the arrow keys to go close to the bottom and put a pound (#) in front of key 46. That's the key. If you want to change it to something else, go ahead. I tried making it a POWER WAKE_DROPPED key, but it just didn't work out for me- I just wanted nothing. Anyways, when you've changed it, or added your # to comment the line out, hit the menu button, and Save & Exit. It'll take you back to root explorer, and it should let you know it saved a backup named s3c-keypad.kl.bak. Reboot, and you are all set.
If you don't have root explorer, and instead just have the free explorer, things get a little trickier. You need at least superuser, then get terminal explorer (free), and open it- type in su (for superuser), and superuser should catch it and add terminal explorer to the list of apps. Once you can successfully su, you'll want to go to the directory above, and chmod 666 s3c-keypad.kl, changing the permissions so you can write to it. Then open up explorer, head on over and follow the steps above (it won't create a backup, as it doesn't have write permissions on the directory, I don't think). Anyways, it'll leave you with a brand new s3c-keypad.kl. Next step is to go back to your terminal emulator, and type chmod 644 s3c-keypad.kl
Reboot, and away you go.

Softkeys in 1.2 rooted (MN 4.5.6)

Before the 1.2 update in rooted 1.1 pressing n-button twice would always bring up softkeys, so I didn't have to have that annoying button on the screen. With 1.2 rooted with MN 4.5.6 pressing n-button twice bings up softkeys only in apps that aren't full screen. Full screen apps don't seem to respond to that and simply exit (or whatever their handler for "home" does) on the first n-key press. The only way around that that I found is to have that annoying button up on the screen which seems to work.
Did anyone else encounter this? Is there any kind of a workaround? It is quite annoying to have that button up there when watching videos, etc.
Thanks
My understanding is that B&N changed the home button so it's just a 'back' action now. That being the case, I don't know why you would need softkeys anymore. You can always swipe right to left on the status bar to go back as well.
doncaruana said:
My understanding is that B&N changed the home button so it's just a 'back' action now. That being the case, I don't know why you would need softkeys anymore. You can always swipe right to left on the status bar to go back as well.
Click to expand...
Click to collapse
There is no status bar in a full screen app, and I typically want to hit menu or back.
Reprogramming the Vol+/- keys
mkhuh said:
There is no status bar in a full screen app, and I typically want to hit menu or back.
Click to expand...
Click to collapse
There is an easy mod to edit a couple keylayout files to replace the vol +/- button functions with "back" and "menu" functions. Further, if you can boot a rooted SDcard containing ADB support (or have Connectbot installed), you can do the mod without even rooting.
I have gotten so used to this mod that it's hard to imagine being without it:
For replacing vol+/- with "back"/"menu" (v1.2) on a rooted NC w/ ADB access:
1. cd /system/usr/keylayout
2. mv qwerty.kl qwerty.kl.org
3. mv twl4030-keypad.kl twl4030-keypad.kl.org
4. exit
5. adb pull /system/usr/keylayout/qwerty.kl.org c:\qwerty.kl
6. adb pull /system/usr/keylayout/twl4030-keypad.kl.org c:\twl4030-keypad.kl
On your PC, edit the two ASCII files just "pulled" to replace functions for keys 114 and 115 with "BACK" and "MENU".
1. adb push c:\qwerty.kl /system/usr/keylayout/qwerty.kl
2. adb push c:\twl4030-keypad.kl /system/usr/keylayout/twl4030-keypad.kl
3. adb shell
4. chmod 644 /system/usr/keylayout/*.kl
5. exit
DeanGibson said:
There is an easy mod to edit a couple keylayout files to replace the vol +/- button functions with "back" and "menu" functions. Further, if you can boot a rooted SDcard containing ADB support (or have Connectbot installed), you can do the mod without even rooting.
I have gotten so used to this mod that it's hard to imagine being without it:
For replacing vol+/- with "back"/"menu" (v1.2) on a rooted NC w/ ADB access:
1. cd /system/usr/keylayout
2. mv qwerty.kl qwerty.kl.org
3. mv twl4030-keypad.kl twl4030-keypad.kl.org
4. exit
5. adb pull /system/usr/keylayout/qwerty.kl.org c:\qwerty.kl
6. adb pull /system/usr/keylayout/twl4030-keypad.kl.org c:\twl4030-keypad.kl
On your PC, edit the two ASCII files just "pulled" to replace functions for keys 114 and 115 with "BACK" and "MENU".
1. adb push c:\qwerty.kl /system/usr/keylayout/qwerty.kl
2. adb push c:\twl4030-keypad.kl /system/usr/keylayout/twl4030-keypad.kl
3. adb shell
4. chmod 644 /system/usr/keylayout/*.kl
5. exit
Click to expand...
Click to collapse
Thanks. I realize I can remap the volume buttons, but I just really liked how you could simply double click the n-button before. I guess something about 1.2 update or the MN changed that behavior from before and I guess there is no known way to get that back. Thanks again for your help.

[Q] Customize camera button function

I listen to a ton of audio books and would love it if i could turn my camera button into a pay/pause toggle when my phone is locked (much like plugging and unplugging headphones does).
I have done a lot of searching but found nothing so far. I am running stock rooted atm but will flash to anything that could pull this off.
Anyone know of such a beast?
Assuming you're rooted, go to the market and download a terminal emulator and astro file manager. From there, use astro to navigate into /system/usr/keylayout
copy s3c-keypad and stick it on your sdcard. Long click on it, choose open as, then text, then file editor. Scroll down till you hit the keys in the 40's. From there you have two options: key 46, which is the camera launcher, and key 56 which is the focus button. Modify either one of those, depending on your preference to: MEDIA_PLAY_PAUSE WAKE_DROPPED, then save the file. next, open up your terminal emulator, and type the following:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cp -f /sdcard/s3ckeypad.kl /system/usr/keylayout
Failing that, there is something called music control lite in the market, though I've never used it so I don't know the details. You may also be able to set something up through Tasker. Good luck!
You, sir, are entitled to a cold one on me if you ever come through Memphis
The only exception to your excellent instructions that I made was to make it a WAKE function rather than WAKE_DROPPED and after a quick reboot it is working exactly as I had hoped.
Many thanks!

[Q] Remapping the external keyboard file

The Lenovo Thinkpad Tablet's keyboard folio is a neat little accessory but there is one issue that drives me nuts. (Beside the loss of the USB port). and that is that the Ctrl key also activates the menu (any menu).
So whenever one tries to do a copy and paste using the usual Ctrl + C and Ctrl + V keys, the menu (of the app you are working in) pops up.
Someone suggested to edit the Generic.kl file in /System/usr/keylayout directory and I did, but that didn't work. (Unless i did it wrong).
I'm at a loss. Would anyone have a suggestion on how to remap that key to only be a standard Ctrl and not menu key?
TS
Having the same issue.
But I'm using an external bluetooth keyboard: the logitech one, which was actually designed for the ipad.
I love it, its slim and very good quality keyboard.
Maybe some helpful links:
http://www.kandroid.org/online-pdk/guide/keymaps_keyboard_input.html
And this one has an explanation how this could be solved on a rooted thinkpad:
http://androidforums.com/ally-all-things-root/250271-re-map-key-keyboard.html
Ok, so I was able to remap some keys. Here is what I did.
The key layout files are stored in /system/usr/keylayout
The most important one seems to be Generic.kl which can be edited with a text editor, just use root explorer or the adb commands below. When I first tried my permissions were screwed up and I wrote the directions below but left them here in case they are helpful.
----------
(I edited gpio-keys.kl thinking it controlled the hard keys but it had no effect). While running the Thinkpad it seems as though I was unable to edit these files but I did get things to work using adb while booted into recovery. Here are the steps I took:
First reboot into ClockworkMod Recovery and plug in your thinkpad to your PC via USB
In CWR select Mounts and Storage then Select Mount /system (otherwise it seems adb can't access your system files)
On your computer run cmd and type adb devices (you should see a device listed, if not go check out the ADB setup guide). Now enter the following commands:
adb remount
adb pull /system/usr/keylayout/Generic.kl
This will copy the Generic.kl file to your current directory (you can see it in the command prompt, typically it is C:\Users\[Your Username]\
Browse to the file make a copy of the unedited version and save your backup somewhere and then edit Generic.kl in a txt editor (I like Notepad++)
I changed key 150 EXPLORER to say key 150 MENU, which makes the browser key open the menu instead of your web browser.
After you made your changes save it and then use the following ADB commands to push it back and set the permissions:
adb push Generic.kl /system/usr/keylayout/
adb shell
chmod 644 /system/usr/keylayout/Generic.kl
chown system.system /system/usr/keylayout/Generic.kl
exit
adb reboot
Now your keys should be remapped!
Just thought I'd add this to skip all the ADB and do it right on the tablet:
ES File Explorer (with root permission and /system writeable checked in settings)
Navigate to file, click, choose text, choose ES Note Editor, edit the file as needed, choose save when prompted.
You can change permissions with ES as well.
I like that it automatically makes a *.bak file of whatever you edit and save.
Those are the same steps I did, but it didn't work for me even after a reboot.
And although I did a backup of the existing generic.kl file, I think I may have overwritten it. So I'm going to have to go in search of a fresh one.
TS

Code to move a file to /system ?

Im a galaxy s6 user here, I found out that the switch recent app button (the one on the left of the home button) quite annoying while playing game like vainglory because I misclicked it quite often. After doing some research I found out that it is possible to comment out the key 254 of generic.kl under system/usr/keylayout, then i come out with an idea of creating a new generic.kl which commented out the key 254, then with a click of button on my app it will move the file with the commented key to system/usr/keylayout to replace the old way, vice versa, I will make a restore button there to restore it will the original generic.kl when I wan the recent app switch to start working again. So my question here is what would be the code to move a file to system and replace it? I do have some basic android programming knowledge and my phone is rooted.
Thanks in advance.
if your phone is rooted.
step 1:get root permission
exec command : su
step 2:mount /system to writeable
exec command : mount -o rw,remount /system
step 3:replace file

Categories

Resources