[GUIDE] Take Back Your Headset Controls! - Nexus 4 General

REQUIREMENTS
ROOT ACCESS
SINGLE-BUTTON HEADSET
ANDROID 4.1+
PREFACE
TESTED ON THE NEXUS 4 RUNNING 4.2
If you often listen to music using a single-button headset (the kind that many Samsung devices tend to ship with), then you should know that Google lets you control the headset button. By default, you can:
Play/Pause (Single Press)
Skip track (Double Press)
Launch Voice Search (Single-click Long Press)
Pretty cool, right? So what's the deal, then?
The issue is you CANNOT customize how you want the system to respond to your button input.
What if you want to long press to increase volume?
What if you want to triple click to go to the previous track?
What if you want to double click and hold to decrease volume?
What if you want to launch an app besides Google Voice Search (I personally have bound utter! in place of Google's search!)?
Nope, too bad.
Well, there is a workaround for this.
How does it work?
In /system/usr/keylayout, two files called Generic.kl and hs_detect.kl reside where you can modify the keymapping of the HEADSETHOOK input to an alternate key that is normally found on a 3-button headset, specifically MEDIA_NEXT. Then, you can modify how the system responds to MEDIA_NEXT by using a headset control app.
TO FIX:
**NOTE: ITEMS SURROUNDED BY A BLUE BOX MEAN IT IS THE ORIGINAL VALUE WHILE ITEMS SURROUNDED BY A RED BOX MEANS IT IS THE NEW VALUE**
1) Install the Keytest App found here: https://github.com/chrisboyle/keytest/downloads
2) Once inside the app, press the headset button. On your screen, it should read as follows:
Code:
keyCode=KEYCODE_HEATSETHOOK
scanCode=226
as shown in the following picture: http://i.imgur.com/dogxm.png
3) Using a root-enabled file explorer app (I personally use Solid Explorer), go to /system/usr/keylayout and make a backup of Generic.kl and hs_detect.kl (copying them to your internal storage, for example /sdcard/headset).
4) You will modify these two files on two different lines. The folder should look like this: http://i.imgur.com/ShpCv.png
Generic.kl:
ORIGINAL: http://i.imgur.com/dzmPy.png AND http://i.imgur.com/bdRRz.png
NEW: http://i.imgur.com/ZddZT.png AND http://i.imgur.com/PPAZk.png
hs_detect.kl:
ORIGINAL: http://i.imgur.com/dVaXK.png
NEW: http://i.imgur.com/Deh9r.png NOTE: I MANUALLY ADDED THE KEY 163 LINE IN
Simple right? You are just flipping the two values essentially.
5) Save the changes. Reboot.
6) Open the Keytest app again. Press the headset button. On your screen, it should read as follows:
Code:
keyCode=KEYCODE_MEDIA_NEXT
scanCode=226
as shown in the following picture: http://i.imgur.com/2BSHM.png
7) Now all you need to do is use an app to configure the MEDIA_NEXT key to your liking.
MEDIA_NEXT is a key typically found on 3-button headsets, symbolized by the "Right" key. An app like Headset Button Controller or Headset Droid should do the trick. Both are paid apps, but there are trial versions available. If there are any free alternatives that can do the trick, let me know and I'll add it in! (I am NOT in any way affiliated with the app developers!)
LIMITATIONS
1)A ROM update will wipe/reset the files.
1a) How can you avoid this? Pretty simple, actually! Just keep a backup of Generic.kl and hs_detect.kl after you make the changes to them, and inject them into the zip file before you flash the ROM. You can also use the following script to do this which needs to be run as root, given that you have the two files backed up in /sdcard/headset
Code:
mount -o rw,remount /system
cp -f /sdcard/headset/* /system/usr/keylayout
chmod 644 /system/usr/keylayout/*
mount -o ro,remount /system
2) An actual or simulated "MEDIA_NEXT" input will now not be recognized as a MEDIA_NEXT. This will affect, for example, 3-button headsets or tasker tasks that simulate a MEDIA_NEXT input. Also: ROMs with the long-press to skip tracks will no longer skip track on holding volume-up, as this is no longer recognized as a MEDIA_NEXT input.
2a) How can you avoid this? You can instead use a different key to be replaced rather than MEDIA_NEXT, if you so desire. The work-up will be the exact same, only the values you swap will be different.
CREDITS
Kenkiller: http://forum.xda-developers.com/showpost.php?p=32999600&postcount=38
Headset Button Controller Dev
Headset Droid Dev
Redditor muzeofmobo for the script

Please respond to this post if it worked for you! I don't have my Nexus 4 yet, but I am absolutely positive it works on it as well! It worked for my GNexus on 4.1 and 4.2, and it has worked across many other devices as well.

Bump for visibility!
Sent from my Galaxy Nexus using Tapatalk 2

Thanks for this :good: It'll help me hunting for why I can't get the headset working properly in utter! !

Works PERFECT! THANKS!!!! (for nexus s)

https://play.google.com/store/apps/details?id=se.jays.headsetcontrol
I used to use this app. It offered the same functionality without having to tweak any files. I have not tested on n4 though.

1234568 said:
https://play.google.com/store/apps/details?id=se.jays.headsetcontrol
I used to use this app. It offered the same functionality without having to tweak any files. I have not tested on n4 though.
Click to expand...
Click to collapse
This tweak is meant for long press problem only opening google now. Even Jays says this
"Compatibility
- Click-and-hold actions will not work in Android 4.1+ as Google Now intercepts them."
so even if you use jays your long press should not work unless your rom has helped you change it!

Used this app back in the day before i got my MW600..
https://play.google.com/store/apps/details?id=tvk.headvol

PMaksymiuk said:
Used this app back in the day before i got my MW600..
https://play.google.com/store/apps/details?id=tvk.headvol
Click to expand...
Click to collapse
Yes, Headset Droid is another option for users who don't want to use Headset Button Controller!

I just received my Nexus 4 earlier today, and I saw that there were some changes done in the /system/usr/keylayout folder. I managed to fix the problem, and will update the OP with new pictures ASAP for those looking to fix the headset problem.

OP updated with new instructions specific to the Nexus 4!

First off thanks to the OP. I can confirm that this works perfectly. Really don't understand why Google limited the click-and-hold functionality in the first place.
Despite this method working as expected, it is just tricking the Android system. Would it be possible for developers to actually remove the limitation itself from Jellybean. This would mean that you wouldn't need to inject files after each rom update etc.

IAmAN00bie said:
I just received my Nexus 4 earlier today, and I saw that there were some changes done in the /system/usr/keylayout folder. I managed to fix the problem, and will update the OP with new pictures ASAP for those looking to fix the headset problem.
Click to expand...
Click to collapse
I had the same problem after the JB 4.2.1 upgrade. hs_detect.kl isn't there. The same modifications can be made to set_jack.kl (+ add the line as posted in the original).
This works just fine now!
However, I still can't launch utter (using headset button controller), since the shortcut found in utter main screen creates a shortcut to start listening on the homescreen. Every time I triple press, a shortcut is made to my homescreen.
How did you bind utter to listen?

NEW: http://i.imgur.com/ZddZT.png AND http://i.imgur.com/ZddZT.png
Click to expand...
Click to collapse
OP these are 2 the same images, please edit as some people will get confused
---------- Post added at 09:48 PM ---------- Previous post was at 09:19 PM ----------
Ohh and also... how do you answer a call after changes? Ive tried headset Droid and Headset Button Controller and none of the settings allows me to answer call

MattSkeet said:
OP these are 2 the same images, please edit as some people will get confused
---------- Post added at 09:48 PM ---------- Previous post was at 09:19 PM ----------
Ohh and also... how do you answer a call after changes? Ive tried headset Droid and Headset Button Controller and none of the settings allows me to answer call
Click to expand...
Click to collapse
Oops, didn't catch that! I'll update it when I get done with my finals today ;_;. Did you configure the Right button aka the media next button in headset droid? Remember the configuration changed when you did the mod!
Sent from my Nexus 4 using Tapatalk 2

IAmAN00bie said:
Oops, didn't catch that! I'll update it when I get done with my finals today ;_;. Did you configure the Right button aka the media next button in headset droid? Remember the configuration changed when you did the mod!
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
Yeah I did. Set the right button in the right way and also disabled all other buttons . I can change volume skip tracks play pause but unable to answer calls even tho it is set up
Sent from my Nexus 4 using xda premium

MattSkeet said:
Yeah I did. Set the right button in the right way and also disabled all other buttons . I can change volume skip tracks play pause but unable to answer calls even tho it is set up
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
I never actually used the answer calls feature, as I don't have an inline mic. I'll try to see what's up though.
Sent from my Nexus 4 using Tapatalk 2

Quick update, fixed the OP links. Sorry if I caused anyone confusion. I hope somebody finds this guide useful!

Hey Guys
I have a Galaxy Note 2 and followed the switching steps mentioned to switch.from the middle to right button.
However thiere is a problem that sometimes happens... the "long press" seems to over-ride the single press so that when I'm trying to click once to pause my music, a new song comes on.
The 2nd thing is that for some reason "click and hold" has no effect whats so ever (as I could have just used it instead of long click)
Curious if you guys have had these experiences.

Boogerwooger said:
Hey Guys
I have a Galaxy Note 2 and followed the switching steps mentioned to switch.from the middle to right button.
However thiere is a problem that sometimes happens... the "long press" seems to over-ride the single press so that when I'm trying to click once to pause my music, a new song comes on.
The 2nd thing is that for some reason "click and hold" has no effect whats so ever (as I could have just used it instead of long click)
Curious if you guys have had these experiences.
Click to expand...
Click to collapse
What app are you using to control your clicks?

Related

(Wanted) Optical Sleep Wake

I am wanting to know if anyone can port the program for the nexus to the aria, that when the trackpad is pushed the phone will wake. I know that coming from an Iphone that is a huge benefit.
seconded.
it's a pain to reach over to push the power button every time because the phone slides towards if you if face up on desk pushing trackpad button much more elegant solution.
Hello, I am a new member and I thought I'd join and tell you what I found. I've been using my Aria for about a week already. I used lock2.0 (bugs and keeps your phone running idle, not standby), nolock (basically takes away lock all together and only wakes it up), this widget screen mode (bugs) thing and a couple others..
Anyways the best solution (in my opinion) is this app called "lockbot." It wakes the phone up using the trackpad and volume keys. The free version lacks the password but if you get the pro, you can add the pass code functionality (not for me especially if you need to do an emergency call plus you can always download a kill app in case your phone gets stolen). A good thing about it too is that you can modify your lock screens i.e. iphone style, x10 style, froyo style, etc. I got 5 different types cycling randomly. You can also change a few options i.e. lock during a call so you dont do a "face hang up" or shake to unlock. The only real bug I found so far was the x10 lockscreen because it would lag for about a second.
I know a few may say "oh the side keys will get hit and drain the battery" but honestly, after using the app for like 5 days, I haven't notice any change in battery consumption. Not wearing out your power button pretty much outweighs losing a minuscule of battery life.
Hope it helps. Of course you can try out the other apps to see if they suit you =)
kudvu002 said:
I am wanting to know if anyone can port the program for the nexus to the aria, that when the trackpad is pushed the phone will wake. I know that coming from an Iphone that is a huge benefit.
Click to expand...
Click to collapse
I'm using lockbot now and it's exactly what I was looking for. I'll keep an eye on battery life and report back if it seems to drop.
Awesome suggestion, thanks!!
Btw I was going through the configurations. Apparently you can set a lock code for the lockscreen once you swipe it. You have to pay for the swipe lock but it's free to put in a numeric lock code.
Cheers
I tried lockbot and uninstalled it.
-It does not support the Aria's native resolution.
-Won't let you load BG pics smaller than the 480 x 846 or whatever the res of the device it was made for is.
-When you press the power button to lock and then immediately hit it again, it never locks, just shows the home screen again.
Would it be hard to port the N1's app? I just want something simple that works
nope
didn't work out for me.
almost locked me out of the phone.
I think it doesn't play well with task killer.
Im using an app called "no lock" disables the slide lock and you can jus press the optical button, volume or power buttons to unlock the phone.
pcruz said:
Im using an app called "no lock" disables the slide lock and you can jus press the optical button, volume or power buttons to unlock the phone.
Click to expand...
Click to collapse
Same here, works great.
Sent from my HTC Liberty
This just became available on the Incredible...I am sending the file that needs to be edited to the dev who created it for the Incredible so he can make it work for the Aria as well. You can take a look at the thread here:
http://forum.xda-developers.com/showthread.php?p=7267384#post7267384
If anyone has access to the phone now and knows how to use adb you can pull the file off and send it to him. If not I'll send it to him later tonight.
Optical wake working for me
EDIT-Short Version...
-:Have Clockwork Recovery Installed and know how to use ADB:-
-DOWNLOAD ATTACHED qwerty.kl (may need 7zip to extract file from archive...)
-BOOT into CLOCKWORK recovery with NO USB PLUGGED INto phone!!!
-PARTITIONS>MOUNT /SYSTEM
-adb push qwerty.kl /system/usr/keylayout|adb reboot
END EDIT
First android phone! I love it. I too wanted optical press-to-wake, particularly because my ATT case made the power button a bit of a pain to press. First real post, been here a bit, I mostly just read/search.
Anyways...I had been searching around the file system getting myself acquainted with android and found /system/usr/keylayout.
It has 4 files in it, one of which is qwerty.kl. It sounded promising so I checked it out.
Long story short, I took a look at it, tried changing our DPAD_CENTER to WAKE instead of WAKE_DROPPED (just like the power button, seemed logical ), but it didn't work. Did some more searching and saw that the key was key # 272 on another phone instead of 232 in our qwerty.kl. I have it working now. Here's the thread I read to figure it out http://forum.xda-developers.com/showthread.php?t=729923
I did this in windows...(I have ADB working and Clockwork Recovery, you should get these too, invaluable tools)
1. Boot into clockworkmod recovery
2. Go to Partions Menu and Mount /System
3. adb pull /system/usr/keylayout/qwerty.kl (this pulls a file, qwerty.kl, and puts it in your adb tools directory)
4. Now you need to open the qwerty.kl file and edit it.
5. Use notepad, or notepad++, or vi, anything really.
6. Search qwerty.kl for key 232 DPAD_CENTER WAKE_DROPPED
7. Change 232 to 272
8. Change WAKE_DROPPED to just WAKE
9. Save the file
Now we need to push the file back to the device. This sounds very easy, and is, except I had trouble and got stuck in clockwork twice and had to pull the battery, as I think when I went to select reboot or unmount in clockwork (using the trackpad...), my newly changed trackpad was probably making everything act up. So I tried twice and had to pull batt twice before I just figured I would streamline my commands. (edit-trackpad works normally in clockwork after next step.)
10. do this! adb push qwerty.kl /system/usr/keylayout|adb reboot
This will push your new qwerty.kl file to the phone and reboot it without you having to use the trackpad which could leave you potentially stuck in clockwork recovery, thus avoiding the inconvenience of taking off your case/back.
I attached my qwerty.kl in a 7z archive so you hopefully can just extract it to wherever you need it and just adb push it to /system/usr/keylayout.
Good luck. Let me know if it works.
When the phone reboots you will be able to press the optical trackpad and wake the phone!
I haven't really tested it more than waking the phone a half dozen times but it seems to do what I want. When getting stuck in clockwork concerns me, I will simply edit my qwerty.kl file as needed when doing clockworkmod recovery work as it is a fairly simple and straightforward process.
EDIT-phone functions EXACTLY as before except can now wake via trackpad press!
Questions, why were you using the trackpad in clockwork?
Also, I like how no lock works since I have a security code on my device. When I dont feel like entering my code everytime the screen blacks out, I just run no lock and I wake the device up using the trackpad. Will your modification do the same? Or once I wake the device up, it will take me to the security screen?
SysAdmNj said:
Questions, why were you using the trackpad in clockwork?
Also, I like how no lock works since I have a security code on my device. When I dont feel like entering my code everytime the screen blacks out, I just run no lock and I wake the device up using the trackpad. Will your modification do the same? Or once I wake the device up, it will take me to the security screen?
Click to expand...
Click to collapse
Because I could...? haha. I think it did the same thing when i tried selecting with the power button as well, can't recall, and didn't futz with it enough to remember it today. Could be a clockwork error or my own...
This doesn't get rid of the lock screen, it just wakes the phone with a trackpad push which I believe was the original intent of the thread. "No lock," well...gets rid of the lock screen which is a different function all together. I don't use a code/pattern on my phone, just the standard drag down lockscreen, its not terribly inconvenient to me.
I find it a bit more convenient since my thumb is already there when I pick up the phone. Also, whenever I would demo my phone to anyone else (whether they owned an iphone or not) they would ALWAYS try to push the trackpad to wake it, and I would ALWAYS have to point them to the awkward power button.
I'm not a huge fan of installing random stuff, and this does exactly what I want. Simple fix ftw.
yollasho said:
I'm not a huge fan of installing random stuff, and this does exactly what I want. Simple fix ftw.
Click to expand...
Click to collapse
this is awesome. going to try it once i get home. thank you so much!
edit:
pushed the file with no issues whatsoever. very very helpful.
mattbollenbach said:
this is awesome. going to try it once i get home. thank you so much!
edit:
pushed the file with no issues whatsoever. very very helpful.
Click to expand...
Click to collapse
Really glad it worked for you!
Thank You. your procedure worked flawlessly.
HTC should really rethink their "wake up" button, using power button up on top is a real pain.
yollasho said:
Good luck. Let me know if it works
Click to expand...
Click to collapse
It works ! Thanks man.. very nice find
Very usefull ..
@MOD
Sticky @ Development section please !
haven't done this yet so feel free to correct me but this looks to just change the wake button from the power to the optical. is there a way to allow both to wake the phone?
either way great work.
ryan92084 said:
haven't done this yet so feel free to correct me but this looks to just change the wake button from the power to the optical. is there a way to allow both to wake the phone?
either way great work.
Click to expand...
Click to collapse
Both wake the phone !

(Q) Can I turn off the deafening camera sound? (and others)

That'd be nice. Another few items that are still on the checklist include:
- Button re-mapper. I've used the search function here, but I've only seen this brought up in the context of other phone models and their custom ROMs. Is there a ROOT app that grants me Activator (iPhone) type functionality? I'd love to be able to hold-press skip tracks forward and backward.
- Something to instill confidence in the play/pause button on the stock mic headset. Sometimes it works as it should - other times, you have to press it twice, three times, hold it down, do a rain dance... I know the little guy's got it in him. I've seen him accomplish the feat, it just seems he might need a little encouragement from some ROOT app.
- I've searched quite a bit for this last one. Is there honestly no way to calibrate the S-pen? I do the little rubric that comes up when you dial the #14214# or whatever it is, as well as switching back and forth from right handed to left handed. There aren't any other more fruitful methods?
My ROM is the recent German LPY release.
Thanks guys!
If/when I don't want to hear the camera sound, I just turn the volume all the way to silent. Kind of silly, but I think there is some sort of stupid rule that says phones have to have that sound, so you don't take "bad pictures" of people or some BS.
Search Play Store for "Camera ICS"
It's based on the AOSP camera from 4.0.x but has the menu option of "silent mode"
You can also set the volume keys to be auto-focus and "shoot" for volume +/- so you could hold the phone in "reverse landscape" and have volume keys under right hand fingers then hold volume down then roll finger across to press volume up as well to take the shot? (that's how I have mine configured)
Great camera app! Thanks! No one knows of any fuctioning button remapping software?
u need to be rooted
then use ES File Explorer in setting enable Mount File System R/W
Navigate to
/system/media/audio/ui
rename Shutter_01.ogg to something else
Xephrey said:
That'd be nice. Another few items that are still on the checklist include:
- Button re-mapper. I've used the search function here, but I've only seen this brought up in the context of other phone models and their custom ROMs. Is there a ROOT app that grants me Activator (iPhone) type functionality? I'd love to be able to hold-press skip tracks forward and backward.
- Something to instill confidence in the play/pause button on the stock mic headset. Sometimes it works as it should - other times, you have to press it twice, three times, hold it down, do a rain dance... I know the little guy's got it in him. I've seen him accomplish the feat, it just seems he might need a little encouragement from some ROOT app.
- I've searched quite a bit for this last one. Is there honestly no way to calibrate the S-pen? I do the little rubric that comes up when you dial the #14214# or whatever it is, as well as switching back and forth from right handed to left handed. There aren't any other more fruitful methods?
My ROM is the recent German LPY release.
Thanks guys!
Click to expand...
Click to collapse
Try touchscreen tune for note to calibrate spen (you have to register for a fee to make it stick, but you can test to make sure it works on your rom (requires root). If rooted, you can disable .ogg file as another suggested.
Great suggestions, guys! Thanks so much.
antiguangenius said:
Navigate to
/system/media/audio/ui
rename Shutter_01.ogg to something else
Click to expand...
Click to collapse
Thank you! Works fantastically.
I just replaced mine with a sample of someone saying "gotcha".
Sent from my GT-N7000 using XDA
antiguangenius said:
u need to be rooted
then use ES File Explorer in setting enable Mount File System R/W
Navigate to
/system/media/audio/ui
rename Shutter_01.ogg to something else
Click to expand...
Click to collapse
I enable Mount File System R/W but I can't find /system, any ideas?
Xephrey said:
- Button re-mapper. I've used the search function here, but I've only seen this brought up in the context of other phone models and their custom ROMs. Is there a ROOT app that grants me Activator (iPhone) type functionality? I'd love to be able to hold-press skip tracks forward and backward.
Click to expand...
Click to collapse
I just did a search for this and found this post here (as such I can also confirm what OP has said, and so I'm seconding this notion.)
To add to what OP stated I also would like to create Play/Pause by holding both sides of the respective Volume Buttons at the same time as well. Though I think for that to be done properly I would have to link this functionality to a music based app to prevent unwanted shenanigans.
Delete camera sounds at system media folder (you need root of course).
And replace your camera apk with this (without focus sound to made complete silent camera):
http://forum.xda-developers.com/showthread.php?t=1371755
lexi250 said:
I enable Mount File System R/W but I can't find /system, any ideas?
Click to expand...
Click to collapse
Enable Up to Root
Sent from my GT-N7000
Bump

[Q] Headset double click redial

Has anyone figured out how to disable the annoying feature of sense that makes the phone redial the last number you called when double clicking the headset button?
Is there any files one can edit to disable it and enable double click to skip tracks? I've tried apps from the Play store but they did not function correctly...
I also tried editing the Generic.kl key layout file, but haven't managed to figure out what command to assign, because the standard HEADSETHOOK seems to be coded to do the redial on another level.
Sent from my HTC One using Tapatalk 4 Beta
MaTiCeK- said:
Has anyone figured out how to disable the annoying feature of sense that makes the phone redial the last number you called when double clicking the headset button?
Is there any files one can edit to disable it and enable double click to skip tracks? I've tried apps from the Play store but they did not function correctly...
I also tried editing the Generic.kl key layout file, but haven't managed to figure out what command to assign, because the standard HEADSETHOOK seems to be coded to do the redial on another level.
Sent from my HTC One using Tapatalk 4 Beta
Click to expand...
Click to collapse
As far as I know, on the standard stock ROM you can't, but there are some apps in the Play Store that lets you map button actions. Ex: Two short presses -> skip to next track etc.
I suggest you try Jays Headset Control- make sure to enable "HTC Redial fix" under "Advanced" "Settings"
Jays doesn't work. The headset button control app does but isn't reliable.
Sent from my HTC One using Tapatalk 4 Beta
I use the headset controller app. It's been working great for me. It also has a htc redial fix check in settings.
https://play.google.com/store/apps/details?id=com.kober.headsetbutton
Sent from my HTC One using Tapatalk 2
HTC ONE headset redial fix
MaTiCeK- said:
Has anyone figured out how to disable the annoying feature of sense that makes the phone redial the last number you called when double clicking the headset button?
Is there any files one can edit to disable it and enable double click to skip tracks? I've tried apps from the Play store but they did not function correctly...
I also tried editing the Generic.kl key layout file, but haven't managed to figure out what command to assign, because the standard HEADSETHOOK seems to be coded to do the redial on another level.
Sent from my HTC One using Tapatalk 4 Beta
Click to expand...
Click to collapse
It certainly can be fixed by modifying the Generic.kl file but i found that it breaks a lot of required functionality and needs lot more work to restore those. If your ONE is rooted you can use the Headsetmod Xposed mod in the link http://forum.xda-developers.com/showthread.php?t=2423160 . (Tested and working on ARHD 13.3)

Custom headphones button configuration

Hello does anyone know how to reconfigure custom headphones on our lg 4x? I am using headphones with 3 buttons instead one like in stock lg headphones. All 3 buttons does the same thing. single click play/pause, double click next track and long click is open google voice. if anyone knows the solution it would be great to share :good:
hi,
first of all i would install "jays headset control" to see if you can use the different buttons at all. (you have the option to chose between a one-button and a three-button headset)
if this is not working either, install keytest.apk (google it) and see if each button sends a different keycode. if so, you should be able to use it for your purpose!
cheers
Thanks for your reply. I did the test with keytest.apk and all three buttons sends the same keycode. I have read somewhere that can be changed only by kernel but I don't know how to do it
On our device it's not supported by default, but I recall seeing kholk implement this kinda stuff in eprj kernel, you might check that out.

[APK][LG-D415] LG-D415 QuickButton Editor

This little utility application is designed for assigning a custom action to the QuickButton on the LG Optimus L90 LG-D415. This application is only for LG-D415 devices.
After flashing a custom ROM we basically have a useless button on our device. In my CM11 ROM, selfless plug LOL, I assign a WAKE action to the QuickButton which, when pressed, will wake the device. So the button's not completely worthless. This application was obviously written for LG-D415 users running custom ROMs but it may, as in maybe, work on stock as well.
Anyway in response to a thread that was created recently and also after having thought about it previously, I decided to write this app.
The application is not signed and does NOT have any kind of advertisements. The only requirement is ROOT privileges as it must write to a system file. You will be prompted for root confirmation when the app is launched for the first time, this also depending on how your superuser is set up.
This application modifies, actually replaces, /system/usr/keylayout/gpio-keys.kl. The application will back up your original gpio-keys.kl only the first time you Apply a custom action. That way you still have your original file in case of error. The back up is saved in the same folder as "gpio-keys.kl.bk".
Have fun!!!
I used it. It works. The button now bring up my camera. D415
shinobisoft said:
This little utility application is designed for assigning a custom action to the QuickButton on the LG Optimus L90 LG-D415. This application is only for LG-D415 devices.
After flashing a custom ROM we basically have a useless button on our device. In my CM11 ROM, selfless plug LOL, I assign a WAKE action to the QuickButton which, when pressed, will wake the device. So the button's not completely worthless. This application was obviously written for LG-D415 users running custom ROMs but it may, as in maybe, work on stock as well.
Anyway in response to a thread that was created recently and also after having thought about it previously, I decided to write this app.
The application is not signed and does NOT have any kind of advertisements. The only requirement is ROOT privileges as it must write to a system file. You will be prompted for root confirmation when the app is launched for the first time, this also depending on how your superuser is set up.
This application modifies, actually replaces, /system/usr/keylayout/gpio-keys.kl. The application will back up your original gpio-keys.kl only the first time you Apply a custom action. That way you still have your original file in case of error. The back up is saved in the same folder as "gpio-keys.kl.bk".
Have fun!!!
Click to expand...
Click to collapse
Is it possible to change it to a custom app?
blondgod said:
Is it possible to change it to a custom app?
Click to expand...
Click to collapse
No, I dont think so, mainly because I'm having to use key ids that are pre-defined. I will dig in to it a little deeper tho.
Sent from my LG-D415 using Tapatalk
After some more digging I've determined that there is no way to define a custom application to be called by the QuickButton. At the moment, the only way I can think of to possibly do this is to have a background service running to "listen" for the QuickButton presses and then launch the appropriate activity.
In reality, at the moment in any case, all this app does it trick the system in to believing that the QuickButton is actually the button whose action we assign to it belongs to.
I also found two more actions I missed, "Search" && "Bookmark". Haven't tested "Bookmark" yet so I'm not sure what app it opens. LOL. Will know shortly tho
I've also considered adding "Home" and "Menu" to the list as well. Thoughts?
I like the ideas, I just really liked to set the button to open up my messages.
I really like the app though. Plain and simple.
Sent from my LG-D415 using Tapatalk
blondgod said:
I like the ideas, I just really liked to set the button to open up my messages.
I really like the app though. Plain and simple.
Sent from my LG-D415 using Tapatalk
Click to expand...
Click to collapse
If I find a way, I'll let you know
As for the "Search" and "Bookmark" I mentioned earlier, ehhh, no go. They don't do anything.
OP updated with new version - 0.1.1
[ CHANGES ]
- Removed redundant code
- Significant improvement in speed for writing changes to gpio-keys.kl.
- Application is now setting permissions, ( 0644 ), for gpio-keys.kl as well.
shinobisoft said:
After some more digging I've determined that there is no way to define a custom application to be called by the QuickButton. At the moment, the only way I can think of to possibly do this is to have a background service running to "listen" for the QuickButton presses and then launch the appropriate activity.
In reality, at the moment in any case, all this app does it trick the system in to believing that the QuickButton is actually the button whose action we assign to it belongs to.
I also found two more actions I missed, "Search" && "Bookmark". Haven't tested "Bookmark" yet so I'm not sure what app it opens. LOL. Will know shortly tho
I've also considered adding "Home" and "Menu" to the list as well. Thoughts?
Click to expand...
Click to collapse
So i can choose any app on my stock rom
xantanion said:
So i can choose any app on my stock rom
Click to expand...
Click to collapse
Running stock, there is really no need for my application. As much as I hate to admit it, LOL. At this point in time, no, the only choices are they default apps I have already listed in the application.
I believe in order to implement the ability to launch ANY activity ( APP ), I will need to create a background service to listen for QuickButton presses and then act accordingly. This is still theoretical, but from my programming experience, seems to be the only answer. Granted, I'm a Windows programmer, so there may be something I'm missing or overlooking too. LOL.
Oops... Sorry folks, I made a boo boo with my last uploaded version. There was still an entry for "Bookmark" in the radio button choices. "Bookmark" doesn't do anything. LOL.
New version added to the OP
I may have found a way to allow the QuickButton to open "ANY" application. I'm in the middle, well almost finished, of another project. Once I get a chance, I'll experiment with my latest findings and will let everyone know
Will this work on Lollipop? I'm assuming so but just wanted to make sure before I Install it. If it does, that would be awesome because this useless button is bothering me haha. Either way, great work man.
Suicide_Machine said:
Will this work on Lollipop? I'm assuming so but just wanted to make sure before I Install it. If it does, that would be awesome because this useless button is bothering me haha. Either way, great work man.
Click to expand...
Click to collapse
Sorry, afraid not. Key layouts change in 5.0 and I haven't had time to update the app.
How about making it a screenshot button as well?
LupusGallus said:
How about making it a screenshot button as well?
Click to expand...
Click to collapse
No promises, but I'll see what I can do.

Categories

Resources