Custom headphones button configuration - LG Optimus 4X HD

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.

Related

(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

[GUIDE] Take Back Your Headset Controls!

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?

[SOLVED] Anyone Know How...

Okay, so I want to be able to do a couple of things. The first is nagging me, as I'm sure there's a way to do it, the second I'm not so sure about.
1) I want to be able to access the multi-tasking/Recent Apps list from anywhere. My idea is to push and hold Menu to get it to pop up, since Home uses Google Now when it's pushed and held. I know there was a way to do that with the search key back when we had 4 keys using LaunchKey, but I can't find anything to let me assign push/hold functionality to Menu. I'm rooted, so I'm sure there's a way to do this...
2) This I'm not so sure of. Because of the charging port being on the side of the phone, it works best in my car when it's held in a landscape orientation in my windshield-mounted dock. This is great for everything except one thing: the dialer. I know in most AOSP custom ROMs I've used on other phones, the dialer rotates with the phone. Since I've rarely stuck to stock on a phone before, and we're kind of forced to here, is there a way to get the dialer to rotate?
chrisliphart said:
1) I want to be able to access the multi-tasking/Recent Apps list from anywhere. My idea is to push and hold Menu to get it to pop up, since Home uses Google Now when it's pushed and held. I know there was a way to do that with the search key back when we had 4 keys using LaunchKey, but I can't find anything to let me assign push/hold functionality to Menu. I'm rooted, so I'm sure there's a way to do this...
Click to expand...
Click to collapse
Double tap the home key brings up the recent apps.
Sent from my HTC first using xda app-developers app
1. What jonslice says.
2. Download another dialer in the play store.
Holy crap. I feel so stupid now. How did I not know that? LOL
And yeah, downloaded another dialer. Forgot I could do that (since I've never really done it before). Thanks guys!

[Q] Xperia Z3C FM Radio broken?

I can't seem to get the Z3C FM Radio to tune into any frequencies in the UK, just static. All headphones tested worked fine with Z1C.
Anyone else have any luck getting it to work?
Whilst scanning for stations brings up a load of false positives, I can definitely pick up stations such as the BBC ones including the local station, Heart, Classic, etc.
Tested with Etymotic HF5s, RHA MA750s and Sennheiser CX150s.
Strange, I can't get anything at all, no matter what I try it with. Tried factory reset, repair via PC Companion, still just static. I'm guessing I have a faulty unit.
Works fine here too
Works fine in the US
The FM radio works for me, but only while it is in the foreground or while the notification window is pulled down. It doesn't work in the background for me.
marumari said:
The FM radio works for me, but only while it is in the foreground or while the not if action window is pulled down. It doesn't work in the background for me.
Click to expand...
Click to collapse
It works for me in the foreground or background, when in the background there's a notification icon and some controls there.
ghtop said:
Strange, I can't get anything at all, no matter what I try it with. Tried factory reset, repair via PC Companion, still just static. I'm guessing I have a faulty unit.
Click to expand...
Click to collapse
I have the same problem... I've contacted the support line from Sony and am waiting for a response. Does the same
marumari said:
The FM radio works for me, but only while it is in the foreground or while the notification window is pulled down. It doesn't work in the background for me.
Click to expand...
Click to collapse
do you have stamina on?
ghtop said:
I can't seem to get the Z3C FM Radio to tune into any frequencies in the UK, just static. All headphones tested worked fine with Z1C.
Anyone else have any luck getting it to work?
Click to expand...
Click to collapse
Hi - I am replying a bit late because I just came across this thread while trying to troubleshoot a problem I experienced with the FM Radio this evening, which until now has been functioning perfectly.
This may not be your problem, but I'm going to describe it and a work-around for it, in case others may find this thread later when searching for problems with the Z3/Z3 Compact FM Radio. I hope it helps you, as well.
The problem is apparently due to an unfortunate conflict between the FM Radio app and the Google Now voice-activated search settings ("Ok Google").
The main symptom of the problem is that the FM Radio will not play audio through either the headphones or the speakers. This may be misdiagnosed as a broken radio, or failure to tune any stations, but in reality the radio itself is functioning and stations are being tuned. There is just no sound coming from the speakers or headphones (regardless of the setting of the Headphone/Speaker switch within the FM Radio app).
I discovered the explanation for this problem at the following thread, which deals with the Sony Z2 model, and is claimed, on the thread, to only happen when the Google Experience Launcher (GEL) is used in lieu of Sony's stock launcher. Unfortunately, on my Z3 Compact, the problem is occurring despite the fact that I'm using the stock Sony launcher.
Here is a link to the thread:
http://www.thedroidbot.com/sony-xperia-z2-fm-radio-issue-google-now-launcher-fixed/
Basically, the problem is a conflict between the Google Now service's "Ok Google" voice detection and the FM Radio app. Disabling the service's voice-activation (being able to say "OK Google" to invoke the service in listening mode for verbally stating a query) will restore the FM Radio app's ability to play sound correctly.
To test if this is your problem, try the following steps (the FM Radio app should *not* be active while you do this - use the "Close All" item on the task switcher to make sure the app is not active if you have had it running):
1) Invoke the "Search & Now" settings for Google Services using one of these two methods:
a) Slide up and right from the "Home" icon on the device's bottom center to invoke the Google Now search screen, scroll to the bottom, and tap the "..." menu, and select "Settings"
-or-
b) Run the "Google Settings" app from the installed apps menu screens (or a shortcut, if you have placed one somewhere), and tap the "Search & Now" item
2) Select the "Voice" item
3) Tap the '"Ok Google" Detection' item
4) Uncheck any checked items on this screen ("From Google Search app", "From any screen", "From lock screen")
5) Tap the "<" back symbol at the upper left of this screen
6) Slide the "Audio History" switch to the Off position
7) Tap the "<" back symbol at the upper left of this screen
8) Tap the "<" back symbol at the upper left one last time to exit the settings app
9) Test the "FM Radio" app to see if it is now functional - if so, you must either choose between being able to use the FM Radio app or having the ability to invoke the Google Now service by using the "Ok Google" voice phrase (or you must memorize this sequence of steps and repeat them each time you wish to use the FM Radio app, and then re-enable them when you are done with the app).
NOTE: Disabling the voice activation feature of the Google Now service does *not* mean you are giving up the ability to do voice queries within the Google Now service. To do voice queries will simply require you to press the small microphone icon within the service or on the Google Search widget on your device's home screen to activate and place the service into listening mode.
TJCacher said:
The problem is apparently due to an unfortunate conflict between the FM Radio app and the Google Now voice-activated search settings ("Ok Google").
Click to expand...
Click to collapse
That wasn't the problem in my case, as I could clearly hear radio static just no channels could tune, and also tried it with voice activation off since I'd heard of this conflict too. I returned it and my new one works just fine. Other users may find your detailed description of the other problem useful though, so thanks for posting.
ghtop said:
That wasn't the problem in my case, as I could clearly hear radio static just no channels could tune, and also tried it with voice activation off since I'd heard of this conflict too. I returned it and my new one works just fine. Other users may find your detailed description of the other problem useful though, so thanks for posting.
Click to expand...
Click to collapse
Ok - well, sorry your device was defective, but glad you got it sorted.
Sent from my D5803 using Tapatalk
TJCacher said:
Ok - well, sorry your device was defective, but glad you got it sorted.
Sent from my D5803 using Tapatalk
Click to expand...
Click to collapse
I'd like to thank you for the info. This was exactly the problem with my device. Switching off Google Now fixed it! Now some big fixing updates would be great!
ngoyal3 said:
I'd like to thank you for the info. This was exactly the problem with my device. Switching off Google Now fixed it! Now some big fixing updates would be great!
Click to expand...
Click to collapse
Glad it helped. As far as fixes go, I'm not optimistic since the problem has been around since the Z2 (and I suspect longer), but we'll probably find out sometime early next year when Lollipop is likely to drop for our devices.
Wish there was a good way to get reports like this to the right folks at Sony. There is also a very annoying conflict with this same Google Now feature and the Sony Camera app.
Sent from my D5803 using Tapatalk
well sadly its not working for me.,.,
the radio station is picked up by the app also showing the Info about the station but no sound.,., what so ever,,
moreover,, the radio was working fine before i clear the system/data from the recovery.,.,
my deivce is Xperia Z1 Compact 4.4.2
Thank You
Oh my God!!! Thank you man, that worked just fine for me!!!
TJCacher said:
The problem is apparently due to an unfortunate conflict between the FM Radio app and the Google Now voice-activated search settings ("Ok Google")
Click to expand...
Click to collapse
Perfect workaround. Noticed that my radio didn't work. If I selected TrackID I got 3 or 4 seconds of radio then silence again.
THANK YOU!!!! Worked for me!!! Xperia Z Ultra
ghtop said:
I can't seem to get the Z3C FM Radio to tune into any frequencies in the UK, just static. All headphones tested worked fine with Z1C.
Anyone else have any luck getting it to work?
Click to expand...
Click to collapse
Xperia Z3 Compact radio also not working. Downloaded another radio app (Simple radio) and bingo! I now have all the radio programmes that I want.

Bluetooth audio output - easy way to switch easy?

Came from galaxy series where Samsung smart connect panel let me easily choose where to send the audio output. On my Huawei the only way I have found is to click all the way in to the Bluetooth settings and disabling and enabling profiles on the different devices. Is there any widget apps or something that can help me select without going through the menu?
Solution for this please? Still a problem.
LG had a similar thing. seems like such an obvious thing to have until you don't have it
choose audio output for Mate 20 Pro
solsviken said:
Came from galaxy series where Samsung smart connect panel let me easily choose where to send the audio output. On my Huawei the only way I have found is to click all the way in to the Bluetooth settings and disabling and enabling profiles on the different devices. Is there any widget apps or something that can help me select without going through the menu?
Click to expand...
Click to collapse
Hi, have you got any solutions about that?
I used to use a shortcut and a custom widget maker. I don't remember what ones but you should be able to search Google Play.
Try this. https://play.google.com/store/apps/details?id=com.nordskog.LesserAudioSwitch&hl=en_US
I have used another app for forcing audio through headphones at some point, I'm sure there are other apps for this.
There is no default way to do this on the P20 Pro. You'll have to go with a third party solution.

Categories

Resources