[Q] Customize camera button function - Epic 4G General

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!

Related

[Q] bash shell the hell (I can t set permiss.)

RESOLVED
Dear developers,
I need to make send hardware button work for the menu, because the long press windows make me crazy recalling the current applications instead to give me the real useful menu for the app I use.
I currently use desire on hd2. So searching in the previous posts I found that I can change /system/usr/keylayout/qwerty.kl
No way, I opened Astro, did not change and save the modifications. Then I tried to download a terminal emulator. Do not give me #, but I thought was normal reading other posts(the phone is already rooted) so I tried chown and chmod, but I do not what I have to write to do the trick of edit with ASTRO the 2 lines I need to put the menu (for the apps) in SEND hw button. Furthermore trying using $ ls -latr I discovered that the qwerty.kl is a link that refer to etc/keymap directory. So I tried to use ASTRO to edit the file but also if tell me save, there are not modification, simply the file is not edited.
resolved --> I HAD TO COPY IN SDCARD THE FILE QWERTY BEFORE to MODIFY WITH ASTRO, no need of chmod && Chown

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.

[Guide]How to disable the home key button at screen off [Root Required]

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 ?

CM7.1 MyTouch Slide GPS fix

I am not a developer or even smart. I poked around until I found something that worked for me. Use at your own risk.
I rooted and installed CM 7.0.2 in the past and was pretty happy. When 7.1.0 came out I took the leap. Everything was great except for GPS. GPS did not connect at all. Nothing I did could bring it back other than going back to stock rom. After much frustration and fighting I have it working.
Many people said to make changes to the /system/etc/gps.conf. The problem I had was S-ON was preventing it and nothing I could find explained a work-around. Sorry if I missed it.
I am going to explain what I did to get it going.
Phone details:
- My phone is rooted and CM7.1 installed.
- S-ON
- GPS don't work (even after 30 minutes of waiting)
- Clockwork is on sdcard as update.zip (not permanent)
- Phone is connected to the computer (with adb installed and working)
Proceedure:
1. Unzip the gps.conf.zip file (attached) to the root of your sdcard
2. Turn off the phone
3. Press and hold the volume down and then press the power button
4. Choose "recovery" from the menu and press power (phone will reboot into recovery)
5. Press and hold volume up and press the power button (this may take a few seconds)
6. Choose "Apply sdcard:update.zip" and press power button (assumes clockworkmod is on the sdcard and named update.zip)
7. Choose "mounts and storage" and click the bottom middle button (trackball)
8. While mount /system is selected press the trackball. (sinkinglow suggested that you might need to mount /sdcard as well)
9. Switch to the computer now
10. At a command prompt (DOS) in the folder where adb.exe is located type "adb shell"
11. Type "cd /system/etc" (if you cant get in then you did not mount /system properly)
12. Type "cp /sdcard/gps.conf ."
13. Switch back to the phone.
14. Click the trackball again to unmount /system.
15. Click the back arrow (bottom right)
16. Choose "reboot system now"
Once the phone is back up, you should be all good.
GPS fix htc espresso
Is there anyway that you could maybe post a youtube video on how to do this, or send me a pm.I will give you my contact info.Maybe you could walk me through it.
ok im stuck at (12. Type "cp /sdcard/gps.conf .") i get this in cmd prompt :
C:\Users\Ryan>adb shell
~ # cd /system/etc
cd /system/etc
/system/etc # cp /sdcard/gps.conf
cp /sdcard/gps.conf
BusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi-call binary.
Usage: cp [OPTIONS] SOURCE DEST
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY
Options:
-a Same as -dpR
-R,-r Recurse
-d,-P Preserve symlinks (default if -R)
-L Follow all symlinks
-H Follow symlinks on command line
-p Preserve file attributes if possible
-f Force overwrite
-i Prompt before overwrite
-l,-s Create (sym)links
/system/etc #
then step 13/14 (14. Click the trackball again to unmount /system.) says on phone Error unmounting SYSTEM:!
confused on where to go in cmd prompt i think theres a step missing
Try this
Instead of "cp /sdcard/gps.conf", use :
"cp /sdcard/gps.conf /system/etc"
Worked for me and GPS locks within 15 seconds now.
boss2688 said:
ok im stuck at (12. Type "cp /sdcard/gps.conf .") i get this in cmd prompt :
C:\Users\Ryan>adb shell
~ # cd /system/etc
cd /system/etc
/system/etc # cp /sdcard/gps.conf
cp /sdcard/gps.conf
BusyBox v1.16.2androidminimal (2010-03-28 22:34:51 EDT) multi-call binary.
Usage: cp [OPTIONS] SOURCE DEST
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY
Options:
-a Same as -dpR
-R,-r Recurse
-d,-P Preserve symlinks (default if -R)
-L Follow all symlinks
-H Follow symlinks on command line
-p Preserve file attributes if possible
-f Force overwrite
-i Prompt before overwrite
-l,-s Create (sym)links
/system/etc #
then step 13/14 (14. Click the trackball again to unmount /system.) says on phone Error unmounting SYSTEM:!
confused on where to go in cmd prompt i think theres a step missing
Click to expand...
Click to collapse
Step 12 issue
I think what is being missed it the "." at the end of that comand. The "." is the second argument of the "cp" command and "." means the folder i'm currently in.
If you leave it out you are not telling the cp command where to put the file.
Sorry if I abandoned this post. It sat for weeks with no responses so I quit visiting. Hope it helped you guys out.
Is there anyway that you could post a youtube video on this process.I am missing something
---------- Post added at 05:18 PM ---------- Previous post was at 05:12 PM ----------
Maybe you could send me a pm.Then I could give you my contact info.we could go from there.I just really want to use cm7, but this GPS nonsense is keeping me from doing this.
Assumptions
I made a list of assumptions at the top of the post.
- My phone is rooted and CM7.1 installed.
- S-ON (not required but if you have S-OFF you don't need these instructions)
- GPS don't work (even after 30 minutes of waiting)
- Clockwork is on sdcard as update.zip (not permanent because of S-ON)
- Phone is connected to the computer (with adb installed and working)
So you must have already rooted and installed clockwork as well as CM7. You must have the clockwork (update.zip) in the root of your sdcard. you must have ADB working on your computer and working with your phone (shows in devices list). If you have those then it should be following the steps. I am not currently using my slide and do not have equipment or and account to post videos so that would be difficult. if you can tell me where you get stuck I might be able to help.
Like mentioned before I really don't know what I'm doing. I just tried TONS of stuff till I got a feel for things and found a combination that worked for me.
If you are having issues with rooting or installing CM7 or clockwork then that is beyond this tutorial and there is lots of info out there for that.
My phone is rooted and flashing CM7.1.0 (from CM 6.1.1) is simple.
1.) I can never get "adb shell" to "take to" (for lack of better words) the cmd prompt.I always an error message.Maybe I dont have adb installed and/or running right on my PC and/or phone any help would be awesome.
step # 10 is where I get stopped (in my tracks).
My phone is rooted and flashing CM7.1.0 (from CM 6.1.1) is simple.
1.) I can never get "adb shell" to "take to" (for lack of better words) the cmd prompt.I always an error message.Maybe I dont have adb installed and/or running right on my PC and/or phone any help would be awesome.
step # 10 is where I get stopped (in my tracks).
captorofxxx said:
My phone is rooted and flashing CM7.1.0 (from CM 6.1.1) is simple.
1.) I can never get "adb shell" to "take to" (for lack of better words) the cmd prompt.I always an error message.Maybe I dont have adb installed and/or running right on my PC and/or phone any help would be awesome.
step # 10 is where I get stopped (in my tracks).
Click to expand...
Click to collapse
Try this out before you begin. http://wiki.cyanogenmod.com/wiki/Howto:_Install_the_Android_SDK
Simply start from where it says Windows and you should be good to go.
Did this fix just a moment ago and it worked like a charm. Thanks reiter01
I wish someone would post a video or give (intricate-no detail left out) instructions on how to do this.I video would be the ticket.If I could follow someone or watch someone do it........
I wish someone would post a video or give (intricate-no detail left out) instructions on how to do this.I video would be the ticket.If I could follow someone or watch someone do it........
reiter01 said:
I think what is being missed it the "." at the end of that comand. The "." is the second argument of the "cp" command and "." means the folder i'm currently in.
If you leave it out you are not telling the cp command where to put the file.
Sorry if I abandoned this post. It sat for weeks with no responses so I quit visiting. Hope it helped you guys out.
Click to expand...
Click to collapse
yeah i think that was the problem i didnt see the ''." there and sorry if im being noob with adb i was never any good with cmd prompt, i prefer a GUI
ADB issues
There are countless posts and article about getting adb working. I use a Mac so it's never an issue for me. If you haven't already installed the USB drivers for your specific phone the first time you hook up then you will have issues. Windows will choose a generic driver that ADB can't use. You need to find instructions on removing the generic driver and install the right one.
I'm really glad some had had success with my little tutorial. I am sure there has to be easier ways but it's the best I could come up with.
Worked great
This worked great for me, my GPS now locks on within seconds. One note to add, I had to mount /system and /sdcard. Thank you for this fix.
GUIless
@boss2688: I agree with having a GUI when available. I have no phone programming skills and so I didn't try that. I am not sure if it would work anyway because the S_ON would be in place blocking by the time the GUI shows up. On the other hand, I am sure that someone could make a zip with scripts etc to do what I am doing manually. I tried and failed to make a zip. I wanted to have it work just like you install google apps from clockwork.
@sinkinglow: Not sure why you would have to mount /sdcard. It should be mounted already at that point (I think). I no longer use my slide so I can't go back and test. Thanks for the tip. I will see if I can figure out how to edit the original post and add that as a possible step.
reiter01 said:
@boss2688: I agree with having a GUI when available. I have no phone programming skills and so I didn't try that. I am not sure if it would work anyway because the S_ON would be in place blocking by the time the GUI shows up. On the other hand, I am sure that someone could make a zip with scripts etc to do what I am doing manually. I tried and failed to make a zip. I wanted to have it work just like you install google apps from clockwork.
@sinkinglow: Not sure why you would have to mount /sdcard. It should be mounted already at that point (I think). I no longer use my slide so I can't go back and test. Thanks for the tip. I will see if I can figure out how to edit the original post and add that as a possible step.
Click to expand...
Click to collapse
a much easier way if you don't have experience with ADB would be to use Android Commander. Please see http://androidcommander.com/ (of course you would still need to mount the system from clockwork if you don't have S-OFF) hopefully this helps for those still having issues.
CM7 1 MyTouch Slide GPS fix
Im going up on the 26th, and was hoping to try this slide then bop over to Gothics. Im going to get to the slide and then make the call as to how safe it seems....Backup plan is any other thing time permitting from that spot. Thats how I roll
* I have to run USBDeview.exe and delete everything sometimes. I think the devices get confused etc..
* I also have to use "Vista_x86" drivers as none of them work for me ..in XP SP3
Code:
C:\usb\ANDROID\Vista_x86\androidusb.cat
C:\usb\ANDROID\Vista_x86\androidusb.INF
C:\usb\ANDROID\Vista_x86\androidusb.sys
C:\usb\ANDROID\Vista_x86\htcrndis.cat
C:\usb\ANDROID\Vista_x86\htcrndis.inf
C:\usb\ANDROID\Vista_x86\WdfCoInstaller01007.dll

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