[MOD] Use camera "focus" (halfpress) button as back key - Sony Xperia T, TL, TX, V

I got annoyed with reaching over our huge screen to press the back button, so I made a mod to re-map the half keypress of the hardware camera button to a back key. Holding the camera button from the home screen still launches the camera app correctly and pressing the camera button all the way still takes a picture as normal. To focus you can tap on the screen instead.
Download:
http://d-h.st/6uJ
Installation:
Flash from recovery
Update:
Apparently the zip is hosed. Download this:
http://d-h.st/8UG
and put it in /system/usr/keylayout

Gives error at flashing....

POWER1FM said:
Gives error at flashing....
Click to expand...
Click to collapse
+1

Well, I'm at a loss. I think it's a Windows EOL problem, but I've recreated the updater script in linux and it doesn't fix it. Here's the actual file:
http://d-h.st/8UG
Put it in /system/usr/keylayout

Related

[Q] use the "button remapper" 2 use the "G" key as camera button???

[Q] use the "button remapper" 2 use the "G" key as camera button???
can we use the button remapper to reassign the "G" key (it is useless in CM7) to work as a dedicated camera button???...just an idea though....i tried it myself, but the app was not identifying the "G" key. can any1 of you try it and post whether they succeed in this?...if so, how??
Button Remapper doesn't get the G key (key 95) because it isn't mapped in CM7. So it can't be remapped.
Get Root Explorer, go to system/user/keylayout and open querty.kl in text editor (mount r/w in Root Explorer and long-press the file). Add KEY 95 CAMERA
I believe it is. Save and reboot.
Enviado desde mi LG-P970 usando Tapatalk
Yeah.. I did this and it worked (only to start the camera) but when you try to capture a picture, it doesn't.
Lleweraf said:
Yeah.. I did this and it worked (only to start the camera) but when you try to capture a picture, it doesn't.
Click to expand...
Click to collapse
Try this
key 95 CAMERA WAKE_DROPPED
It should launch the camera + take a picture. At least it did in NOVA. Hey in CM7 when you press to take a picture, it is taken with no preview for some seconds then. Just make sure in the little gallery button after pressing button
antonio1475 said:
Try this
key 95 CAMERA WAKE_DROPPED
It should launch the camera + take a picture. At least it did in NOVA. Hey in CM7 when you press to take a picture, it is taken with no preview for some seconds then. Just make sure in the little gallery button after pressing button
Click to expand...
Click to collapse
still, it only launches camera
but thanks anyway
i use it as the "power and wake" button
i don't have the original CM7 camera app on my cell. i deleted it as i found don't actually use it.
so, i added "key 95 POWER WAKE_DROPPED" as mentioned in the following comment and it worked!!! now i use it as my lock/wake key instead of the upper one as it more comfortable than the actual lock key
http://forum.xda-developers.com/showthread.php?t=1194058
If I edit this file system/user/keylayout/querty.kl to add the G buttons and then use the button remapper? This work? I can't test it right now...
I can only lock the device, I can't unlock it...

[RFC] Remapping volume buttons

The volume buttons can be remapped to other buttons by editing the file /system/usr/keylayout/sec_key.kl. The problem is changing this file requires a reboot to take affect.
I wrote a daemon to allow on the fly remapping. It works by using uinput subsystem to create a virtual keyboard, listening to the real keyboard /dev/input/event1, and sending the mapped keys to the virutal keyboard whenever a key is pressed.
In order to use it, you need to edit the file /system/usr/keylayout/sec_key.kl, removing (or commenting out with #) the first two lines, and reboot. After this step, the volume buttons are ignored. Now run the daemon (as root). The default configuration is to send SPACE/SHIFT+SPACE for VOL-/+ to firefox and the default browser, down/up arrow to tapatalk, and VOL-/+ to everything else.
The daemon opens a named pipe on /app-cache/.uinput-virtual-keyboard-fifo and can be configured using this pipe.
For example, the command
echo profile com.sec.android.app.ve 231 44
Will map the keys in the video editor to CALL (open phone) and Z.
The daemon is at http://my.svgalib.org/android/pgdn
Source at http://my.svgalib.org/android/pgdn.c
Comments are welcome.
You, dear sir, are a genious.
Really appreciate your effort. Works like a charm.
Sent from my GT-N7000 using XDA App
Can you provide for a key remap for the stock camera application? Volume up capture picture, volume down focus mode?
Thank you!
Sent from my GT-N7000 using xda premium
The file with the meaning of the keys is /system/usr/keylayout/Vendor_04E8_Product_7021.kl according to it FOCUS is 211 and CAMERA is 212. Unfortunately, FOCUS appears to do nothing, so if you run the command
Code:
echo profile com.sec.android.app.camera 211 212 > /app-cache/.uinput-virtual-keyboard-fifo
The VOL+ button will take a picture, but the VOL- button does nothing.
(There is currently no configuration file, so this command needs to run everytime the daemon is started).
MatanZ said:
The volume buttons can be remapped to other buttons by editing the file /system/usr/keylayout/sec_key.kl. The problem is changing this file requires a reboot to take affect.
I wrote a daemon to allow on the fly remapping. It works by using uinput subsystem to create a virtual keyboard, listening to the real keyboard /dev/input/event1, and sending the mapped keys to the virutal keyboard whenever a key is pressed.
In order to use it, you need to edit the file /system/usr/keylayout/sec_key.kl, removing (or commenting out with #) the first two lines, and reboot. After this step, the volume buttons are ignored. Now run the daemon (as root). The default configuration is to send SPACE/SHIFT+SPACE for VOL-/+ to firefox and the default browser, down/up arrow to tapatalk, and VOL-/+ to everything else.
The daemon opens a named pipe on /app-cache/.uinput-virtual-keyboard-fifo and can be configured using this pipe.
For example, the command
echo profile com.sec.android.app.ve 231 44
Will map the keys in the video editor to CALL (open phone) and Z.
The daemon is at http://my.svgalib.org/android/pgdn
Source at http://my.svgalib.org/android/pgdn.c
Comments are welcome.
Click to expand...
Click to collapse
Thanks for the information !..great work. Can you provide how to remap the power button for taking pictures with the camera (sorely missed especially for this device due to its size; touchscreen very awkward esp. for 1-handed shots and have been asking a lot for this even tried to do this myself based on SGS2 hacked camera but got nowhere)
Thanks !
You can try with this (untested) daemon which allows for mapping all four hardware buttons:
http://my.svgalib.org/android/pgdn4
You need to disable the buttons by also removing the 102 and 116 lines from the file /system/usr/keylayout/sec_key.kl and rebooting. By default home and power map to home and power on all applications except for camera, where power, vol+ and vol- map to camera button (take a picture).
I've tried to map the volume buttons 4cm down on the left side.
Wont work. Then i tried for another 2 hours to map them to the right side of my note. (under the on/off button).
Didn't work too...
What am i doing wrong? Do i need a screwdriver to execute the script and the buttons?
What i have done as a temporary measure is edit the
/system/usr/keylayout/sec_key.kl
so that i can use volume down button to start camera as well as take pics
Could someone explain in more detail how to run a daemon? Thanks.
[Edit] Solved. I used Script manager to run it as "is executable" as root and at boot up. But I have to copy it to the internal memory to run it, otherwise, "permission denied".
Thanks. really like it but few issues noted
1. For the camera mod as suggested in post 6 - The home button does not work after the daemon is run. Long press works however.
2. The daemon needs to be in internal memory for it to work with script manager. If in sd card it shows permission denied.
Also since its in internal memory, it gets deleted every time at boot and hence have to copy it there every time after boot.
Is there any other app to run the daemon from sdcard ?
Thanks
drgopoos said:
Thanks. really like it but few issues noted
1. For the camera mod as suggested in post 6 - The home button does not work after the daemon is run. Long press works however.
2. The daemon needs to be in internal memory for it to work with script manager. If in sd card it shows permission denied.
Also since its in internal memory, it gets deleted every time at boot and hence have to copy it there every time after boot.
Is there any other app to run the daemon from sdcard ?
Thanks
Click to expand...
Click to collapse
I put the file under /system, and it won't be deleted every time it bootup.
wonghyf said:
I put the file under /system, and it won't be deleted every time it bootup.
Click to expand...
Click to collapse
how about the home button not working ?
has that happened ?
drgopoos said:
how about the home button not working ?
has that happened ?
Click to expand...
Click to collapse
It's working for me.
wonghyf said:
It's working for me.
Click to expand...
Click to collapse
After running the script my home button does not work . Long press works.
Will try to redo everything once more i guess.
wonghyf said:
I put the file under /system, and it won't be deleted every time it bootup.
Click to expand...
Click to collapse
I think the best partition is /data. This partition is ext4, so supports executable, symlinks, etc. And is mounted rw, so it does not need to be remounted for every change.
If you want to make the daemon suid root, it has to be on /system, since /data is by default mounted with option nosuid.
MatanZ said:
You can try with this (untested) daemon which allows for mapping all four hardware buttons:
http://my.svgalib.org/android/pgdn4
You need to disable the buttons by also removing the 102 and 116 lines from the file /system/usr/keylayout/sec_key.kl and rebooting. By default home and power map to home and power on all applications except for camera, where power, vol+ and vol- map to camera button (take a picture).
Click to expand...
Click to collapse
Thanks ! works like a charm ! (finally camera with power button to take picture on note..so many camera mods but no one doing this mod which was so easily available on sgs, sgs2), Thanks !
Can someone post a modded camera apk to take pics with volume or power button?
This mod is awesome!
Thanks!!!!!
Sent from my GT-N7000 using xda premium
Surprised to that this was popping up in battery stat to use some battery....
@Taptalk-GalaxyNote
should be possible to input the passw with the volume control?
my email forces me to lock with strong password. Should be possible to start and script with a remapped button, producing to input the password stored on it and unlock screen?
Thanks a lot.

How to remap the G-key to any app?

I saw threads remap the g-key to camera. But I want to map it to a volume app.
Thanks for the help.
Here is what i found;
1.Firstly, you need a rooted LG Optimus Black.
2.Find the file“TWL4030_Keypad.kl”, it’s in /system/usr/keylayout/
3.Backup the file, copy or rename.
4.Then open the “TWL4030_Keypad.kl”, scroll down to 3rd line from the bottom, it should be “key 95 GESTURE”.
5.If you want to use your phone’s “G Button” as camera button, change it to “key 95 CAMERA WAKE_DROPPED” (Once you launch the camera app, you can press the “G button” to take a picture immediately)
6.If you want to use use your phone’s “G Button as power/lock button, change it to “key 95 POWER WAKE_DROPPED”
7.Save the changes and reboot the device.
also found in here : http://forum.xda-developers.com/showthread.php?t=1194058
You get the trick right? With a little luck you can remap it to anything you want. You can write volume i guess... But volume has 2 options "+" and "-". So even if you manage to do it you will only be able to remap one of them. It's either "volume +" or "volume -" Since G is only one button.
Thanks a lot man!
The Volume i mean is just an ordinary app from the market called "volume toggle free". So an instruction about remapping the gkey to any app should work. How?
BoyBawang2 said:
Thanks a lot man!
The Volume i mean is just an ordinary app from the market called "volume toggle free". So an instruction about remapping the gkey to any app should work. How?
Click to expand...
Click to collapse
Sorry for the confusion. I just saw the volume part. But no need to get excited, i just wanted to help. I'm sure someome knows it and will post it. Good day, man...
do you how to change "g" key to wake up the screen. I'm using marvel 4

How do I take a screen shot of an open program?

so, I haven't rooted yet, and am trying to take screen shots of some open programs. I know you are supposed to either hold the power button and volume down together, but its impossible with my fat fingers to do that properly; I also saw that holding home and power is supposed to work, but that doesn't either.
Also, the quick memo program, which supposedly does that too, doesn't do it; when I invoke that, I just get a blank, yellow page to show up, not the open screen of the open program..
Am I missing something?
thanks!
wase4711 said:
so, I haven't rooted yet, and am trying to take screen shots of some open programs. I know you are supposed to either hold the power button and volume down together, but its impossible with my fat fingers to do that properly; I also saw that holding home and power is supposed to work, but that doesn't either.
Also, the quick memo program, which supposedly does that too, doesn't do it; when I invoke that, I just get a blank, yellow page to show up, not the open screen of the open program..
Am I missing something?
thanks!
Click to expand...
Click to collapse
I have big hands too. Try pushing the middle area between the Vol down and Power with one finger. Just a pretty quick push. Works for me your results may vary.
thanks man, it took a few tries but I got it to work! :good::good:
sn707 said:
I have big hands too. Try pushing the middle area between the Vol down and Power with one finger. Just a pretty quick push. Works for me your results may vary.
Click to expand...
Click to collapse
it make me so mad every time i try the volume go down it was more easy with the buttons on the side, i just use the QuicMemo on the top settings screen then i click save to galery
if you are rooted, there are some programs in the market that will help...
Apps for taking screenshots
Apps are available in Google Play Store, that allow to take screenshots of your phone's screen.
With root, Install Xposed framework- gravity box. Then enable screenshot option on power menu.
Sent from my LG-D959 using XDA Premium 4 mobile app
Try "Screenshot Ultimate" from "Ice Col Apps"

[Q] On Screen Buttons do behave weird >_<

Yo.
I got the One M7 with Viper 6.1
I managed to get on screen buttons by opening build.prop and editing qemu.hw.mainkeys=0 into it
Back and home works. But when I press multitask it does MENU and when I hold it for like 0,3 secs it does multitask
1) How can I make the Multitask button to do MULTITASK >.<
2) And how can I make hold multitask to menu?
3) And how to deactivate hardware buttons? ^^
Infact I wanna invert it xD
If you want to make the capacitive buttons to stop working, look here: http://forum.xda-developers.com/showpost.php?p=52404644&postcount=2
ZeroInfinity said:
If you want to make the capacitive buttons to stop working, look here: http://forum.xda-developers.com/showpost.php?p=52404644&postcount=2
Click to expand...
Click to collapse
Thank you! =)
Now I tried to reinstall VIPERONE 6.1. Did Backup. Wiped everything. Installed ROM
I turn on software buttons.
Still multitask does menu and holding 0,3 sec does multitask
Why =(
Uhm do you know how to change Softwre Button Key binding? I've google'd and failed to find something D:
EDIT: Problem fixed =)

Categories

Resources