Headphone-Jack-Switch

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

User avatar
schuster666
Posts: 52
Joined: 13 Nov 2013 14:03
Location: Germany / Neuss

Headphone-Jack-Switch

Post by schuster666 » 04 Sep 2015 04:00

Hi Martin,
is it possible to use this kind of switch to run a flow or set a variable?

can you make it happen?

greatings
-- the world would be better without people--
-- but boring --

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Headphone-Jack-Switch

Post by kintrupf » 04 Sep 2015 06:04

Take a look at the trigger Wired Headset Plugged. You can react when it is plugged or unplugged.

User avatar
schuster666
Posts: 52
Joined: 13 Nov 2013 14:03
Location: Germany / Neuss

Re: Headphone-Jack-Switch

Post by schuster666 » 15 Sep 2015 15:22

OK, here is a photo of the plug. it is not reachable in AM.
any hint?
Attachments
20150915_171822.jpg
20150915_171822.jpg (660.87 KiB) Viewed 25829 times
-- the world would be better without people--
-- but boring --

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Headphone-Jack-Switch

Post by MURTUMA » 15 Sep 2015 16:44

I believe there were a discussion about that thing or something similar in the past. I can't remember any relevant keyword to find that topic, but maybe you can find it with the product name?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Headphone-Jack-Switch

Post by Martin » 17 Sep 2015 19:56

You could try trigger Media Button Event to see if Automagic detects the button. Action Reregister Media Button Receiver could be required when media players are handling the events..

eldron
Posts: 45
Joined: 27 Apr 2015 08:21

Re: Headphone-Jack-Switch

Post by eldron » 21 Sep 2015 13:29

Please share your result with us, I´d be interested to hear if you managed to get it to work with automagic.

eldron
Posts: 45
Joined: 27 Apr 2015 08:21

Re: Headphone-Jack-Switch

Post by eldron » 23 Sep 2015 20:53

Hi,
although I didn´t get any feedback, I decided to get one of those headphone buttons myself.
It was not the first time that I had considered buying one and as you can get them for about 3 euros now, there was nothing to loose.
My intention was to use automagic to give the button the desired functions, instead of using one of the available apps (ikey, keycut, ...).
And what can I say - it works like a charm!
I now have a neat little hardware button to turn on the flashlight. And of course only when the screen is unlocked, nothing is too close to the proximity sensor and with an auto turn off after 3 minutes - I just love Automagic!
It even allows you to give a different function to a long click (at least on the galaxy S4), by using the "Speech web search requested".
I´d like to say thanks to Martin for this great app!
There is one problem though - the phone obviously goes into headphone mode,when a headphone button is plugged in. So there is no sound, apart from incoming calls.
Is there any way to turn that mode off with automagic?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Headphone-Jack-Switch

Post by Martin » 24 Sep 2015 19:35

I'm not aware about an official way to prevent that the button is detected as a headset. Actually I would be interested to know how Pressy and similar apps try to workaround this problem. Does the app SoundAbout work on your device?

eldron
Posts: 45
Joined: 27 Apr 2015 08:21

Re: Headphone-Jack-Switch

Post by eldron » 24 Sep 2015 20:14

I would also love to know how the pressy app can recognize that it´s a pressy and not a headphone that´s plugged in.
But I was not looking for a way to prevent the headphone button from being detected as a headset - I think that would be very difficult. I was rather looking for a way of manually switching between headphones connected / disconnected. I came across Soundabout, but it requests too many permissions for my taste and has too many other functions that I don´t need.
I ended up using HF Button Widget, which works perfectly, even under lollipop (at least on my S4). It´s only function is to switch the headphone mode on / off.
The only downside is that it´s a widget, so I can´t launch it through automagic (control UI would be the only way I can think of, but not very practical). That´s why I was hoping that there might be a way to do the switch through automagic.
Maybe that would be an interesting feature to implement in the future, as automagic could then be used as an awesome alternative for all those pressy like apps.
By the way, would there be a way to make automagic distinguish between a single/double/triple click, like those other apps do?
Like that you could assign loads of different functions to the button. I tried the execution count condition, but I couldn´t figure out how to prevent it from triggering the single execution when you press twice.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Headphone-Jack-Switch

Post by MURTUMA » 25 Sep 2015 01:59

An Xposed mod "xposed additions" allows to override hardware buttons. I'm not sure if it works with media buttons, but everything else works flawlessly. I have it even run some flows when pressing some key combination. If you feel safe to install Xposed framework to your device, you should give it a try.

Locked