[Q] hardware key shortcut - Android Q&A, Help & Troubleshooting

hi, i'm trying to add a shortcut to a volume control app when i press both volume up and down keys following this thread:
http://forum.xda-developers.com/showthread.php?t=695936&page=9
i changed the init.rc with rootexplorer and added this lines
"service volumecontrol /system/bin/volumecontrol
oneshot
disabled
keycodes 114 115 "
114 and 115 are the key numbers to volume up and down.
In /system/bin i created a file with the text:
"#!/system/bin/sh
am start -a com.revsodev.volumecontrol -n com.revsodev.volumecontrol/.VolumeControl "
Which is the code to start the app (tested wwith adb terminal and worked) named volumecontrol.
But when i reboot my phone init.rc changes to what it was before i edited it. And the shortcut doesn't work.
What i'm doing wrong?

Well, if anyone want to try this i made it. Used a .sh file in the system/bin and just inverted the order of the keycodes...

Related

[Q] How to disable the home key button at screen off in Cobrato's miui GB 1.7.15

How to disable the home key button at screen off in Cobrato's miui GB 1.7.15?
i 've try Pierre's method which is :
•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
my problem is after i edit, save&exit, the "WAKE_DROPPED" can't be removed or cant edit at all. Why? How come this rom won't allow me to edit es209ra_keypad.kl file?
i'm using root explorer ver 2.16,Click on the button ‘Mount R/W’ ,set permission rw-r--r--
Hope some1 can help. TQ
maybe copy your file to pc, edit it with notepad ++ or something & copy it back to your phone in its original location & overwrite the existing file & set the permissions?
thanks!! It's work with ur method. But it also disable the long press to on the torch as well. That's ok for me.

[Tutorial] Changing the key layout

So, here's how to edit the physical and virtual buttons on your phone, tested on Live with Walkman and should work on any Android ROM and version.
Using Root Explorer:
Navigate to /system/usr/keylayout and open cyttsp_key.kl for soft buttons and pm8085-keypad.kl for physical buttons.
Open the above file(s) using Text Editor (long press).
Change the values to what you want, examples:
MENU = menu
BACK = back
SEARCH = search
APP_SWITCH = recent apps
MUSIC = music player
POWER = lock/power
HOME = home/recent apps
Using ADB:
Type:
adb remount
adb pull system/usr/keylayout/cyttsp_key.kl
adb pull system/usr/keylayout/pm8085-keypad.kl
Then open them in Notepad++ , NOT IN WINDOWS NOTEPAD!
Change the values to what you want, examples:
MENU = menu
BACK = back
SEARCH = search
APP_SWITCH = recent apps
MUSIC = music player
POWER = lock/power
HOME = home/recent apps
Then type:
adb push cyttsp_key.kl system/usr/keylayout
adb push pm8085-keypad.kl system/usr/keylayout
adb shell chmod 655 system/usr/keylayout/cyttsp_key.kl
adb shell chmod 655 system/usr/keylayout/pm8085-keypad.kl
adb reboot
Done!
Please press Thankes if I helped
do you know how to use the music key to open the xperia s player like the stock player? because the only way to make it works with that player (by lasan) its for pause and play button...
attack11 said:
do you know how to use the music key to open the xperia s player like the stock player? because the only way to make it works with that player (by lasan) its for pause and play button...
Click to expand...
Click to collapse
My guess is that you go to system/app and copy xperia s music player to there and rename it to the name of the music player that opens when you press the key, example:
Rename apollo.apk to music.apk or whatever the name is
Hey, how are you, hope you well, as I activate the music player with the button on the camera when it is off the screen? That is, play and pause tracks. I have a SK17. Thanks in advance.
markbonn said:
Hey, how are you, hope you well, as I activate the music player with the button on the camera when it is off the screen? That is, play and pause tracks. I have a SK17. Thanks in advance.
Click to expand...
Click to collapse
I think that is related to app modding, I don't want to enter that now since I'm going to format my PC, so I suggest you to PM someone like Lasan or ask it in the forum of the ROM
xdevilium said:
So, here's how to edit the physical and virtual buttons on your phone, tested on Live with Walkman and should work on any Android ROM and version.
Using Root Explorer:
Navigate to /system/usr/keylayout and open cyttsp_key.kl for soft buttons and pm8085-keypad.kl for physical buttons.
Open the above file(s) using Text Editor (long press).
Change the values to what you want, examples:
MENU = menu
BACK = back
SEARCH = search
APP_SWITCH = recent apps
MUSIC = music player
POWER = lock/power
HOME = home/recent apps
............
.........
Click to expand...
Click to collapse
TNX A LOT BRO...
I JUST NEEDED THE WORD : "APP_SWITCH" !
IT WORKS )
do u know how to disable Long-Press Home button ?!

(Mod) Change Search Button to ICS Recent apps

ROOT needed!!!
Tried on ics based roms.
1.Need file explorer like Root explorer, or #Es file explorer
#IF you are using Es file explorer go to--->Settings->Root Settings->And enable all of them
2.Go to system/usr/keylayout/atmel-touchscreen.kl(in most roms)
For your safeness backup file(for restoring)
3.Open that file like text,change the code
FROM
Code:
key 102 HOME
key 139 MENU
key 158 BACK
key 217 SEARCH
TO
Code:
key 102 HOME
key 139 MENU
key 158 BACK
key 217 APP_SWITCH
4.Menu->Save
5.Reboot
6.ENJOY !!!

[HOW-TO] [STOCK] Disable volume wake while using alternative lockscreen app

Hi all, I'm a noob here on xda but I've been playing around with our Ace for a lot of time! I open this thread to share with you a little trick that I really can't find anywhere in the internet, so I hope it can helps you, sorry for my English.
First, did you ever tried a lockscreen replacement app on stock roms and noticed that everytime you put your phone in the pocket and press the volume buttons accidentally (or just to turn up the music's volume), the screen turns on? Well, for a lot of people it's a good thing, not judging, but what if like me you hate that thing and want to fix it? The only lockscreen replacement app that do it natively is WidgetLocker Lockscreen, but what if an app like GO Locker/MIHome/MILocker or any other lockscreen replacement app has a theme that we like a lot and cannot replicate on the teslacoil's app? Then here's the fix:
Notice: you need to have a rooted phone and a root file manager like Root Explorer (suggested) to make this happen
[1] With the file manager, navigate to /system/usr/keylayout;
[2] Open the file "qwerty.kl" with a text editor (should be integrated in the file browser app, if not copy the file on your sdcard, copy it on your PC and then edit it on your PC, next you have to restore the edited file in its original location, setting permissions to rw-r--r--)
[3] In qwerty.kl, find these lines:
"key 115 VOLUME_UP WAKE"
"key 114 VOLUME_DOWN WAKE"
and delete the "WAKE" so they looks like "key 115 VOLUME_UP" and
"key 114 VOLUME_DOWN"
[4] Save the file (and if you modified it from pc, copy it back to /system/usr/keylayout and set permission like explained on step 2
[5] Do the same with "sec_key.kl" (only the key 115 VOLUME_UP and key 114 VOLUME_DOWN lines, remember)
[6] Reboot your phone
NOTE: IF YOU WANT TO DISABLE WAKE EVEN WHEN YOU USE THE MICROPHONE BUTTON ON ORIGINAL SAMSUNG EARPHONES
[A] Edit the AVRCP.kl file deleting every "WAKE" from the file
Edit the sec_jack.kl file, scroll down to the bottom and delete the WAKE from the line "key 226 HEADSETHOOK WAKE"
Guess that's all, hope this thread isn't against forum rules or useless, so hope it helped

[Q] How to edit init.rc [EDIT: adding app shortcuts to hardware keys]

I want to add a service in init.rc, but everytime i boot my phone the service i wrote is gone. What i'm doing wrong? (i'm just writing opening init.rc with text editor with root explorer)
ffp. said:
I want to add a service in init.rc, but everytime i boot my phone the service i wrote is gone. What i'm doing wrong? (i'm just writing opening init.rc with text editor with root explorer)
Click to expand...
Click to collapse
It is located in Kerenl's Ramdisk , you must unpack the boot.img and edit in ramdisk and repack it
Don't ask me how to unpack or etc .. , use the search
Hit the thank if i clear you out of confuse
Thanks, i got it. But i couldn't make what i wanted to work. I'm trying to add a shortcut to a volume control app.
I'm adding a service in init.rc with this text:
"service volumecontrol /system/bin/volumecontrol
oneshot
disabled
keycodes 114 115"
114 and 115 are the volume up and down keys.
And inside system/bin i created a file named volumecontrol with the script:
"#! /system/bin/sh
(here i added the command to start the apk that i already tested in terminal and worked)"
I don't know why this isn't working. What i'm doing wrong?
read the source, Luke
From https://android.googlesource.com/platform/system/core/+/master/init/readme.txt your 'keycodes' line should be appended to the first (invoking) line & it should not have the qualifier 'disabled'
---------- Post added at 08:50 AM ---------- Previous post was at 08:40 AM ----------
Although, potentially more appropriate is using /system/bin/sysinit which is normal shell script with the normal first line
Code:
#! /system/bin/sh
volumecontrol keycodes 114 115

Categories

Resources