Is there any way to map long-press of the "back" button?

227 views
Skip to first unread message

Soudane GMTA

unread,
Aug 24, 2023, 2:07:17 PM8/24/23
to Tasker
I'm on Android 13, and I'm running the latest Tasker beta with the latest AutoInput utility.

I'd like to map a long-press of the "back" button to my own action.

I know that I can do this with GravityBox, but that utility does not work properly under A13 on my device, and I'm looking for an alternative way to do that mapping via Tasker in conjunction with AutoInput, or via Tasker in conjunction with perhaps some other suitable utility.

Is there any way to do this?

Thank you in advance.


Robert Ryan

unread,
Aug 24, 2023, 2:46:54 PM8/24/23
to tas...@googlegroups.com, Soudane GMTA
You can use AutoInput's UI Action command to map long-clicks of the back button. 

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/a3fbd530-73ec-479c-ad0b-6097fdfd49bcn%40googlegroups.com.

Soudane GMTA

unread,
Aug 24, 2023, 2:59:39 PM8/24/23
to Tasker
Thank you very much.  However, I can't find any way to map the "back" button in AutoInput. Do I have to reference the "back" button by its screen coordinates?

Also, I don't even see a "UI Action" category in AutoInput. All I see with "UI" in its name is "UI Query".

What am I missing?

Robert Ryan

unread,
Aug 24, 2023, 4:38:47 PM8/24/23
to tas...@googlegroups.com, Soudane GMTA
Sorry, it is actually an Event context. See attached. 

Screenshot_20230824-143554_Tasker.jpg

Soudane GMTA

unread,
Aug 24, 2023, 6:00:32 PM8/24/23
to Tasker
Thank you again.

But unfortunately, my version of AutoInput is not offering any "AutoInput UI Action" settings, nor anything to do with setting buttons.

I'm running the April 4, 2023, AutoInput beta on my rooted A13 phone.

Brenden M

unread,
Aug 25, 2023, 3:03:14 PM8/25/23
to Tasker
In the "PROFILES" tab of a project, not "TASKS", I can add a new Event profile trigger, go to Plugin, go to AutoInput, and see the option UI Action, as visible below.

From there, I can select UI events, such as a long-press on the back button, to trigger that profile.
The UI Action is the event that you want to use to trigger your Task.

Where are you looking? Can you find the screen below? Are you saying this list does not have UI Action in it?
"Your Version" is not very descriptive of what you're looking at.
AutoInput UI Action as Event Profile option.png

Soudane GMTA

unread,
Aug 25, 2023, 5:09:13 PM8/25/23
to Tasker
OK, I'm sorry. I was incorrectly working in Tasks, not Profiles. I should have known better.

Anyway ...

In Profiles, I select Event.
Then I select Plugin.
Then I select AutoInput.
Then I select UI Action.

Then, I get to a screen labeled Event Edit upon which I can select Configuration.

I select Configuration, and the only items offered to me are Action Types and Element Text.

So, I select Action Types.
Then, a menu comes up in which I can select Clicks, Long Clicks, Input Element Focused, and Input Element Focused Lost.

I first try Long Clicks, but it just comes back with the AutoInput UI Action menu, in which I can select either Action Types or Element Text.

I select Action Types, but now I just get sent back to the same earlier menu in which I can select Clicks, Long Clicks, Input Element Focused, and Input Element Focused Lost.

Re-selecting Long Clicks just repeats this.

And I tried Clicks instead of Long Clicks, but I still just get into the same state.

It seems like I can't ever use UI Action get to a screen which allows me to select back button or any other items.

So, instead of UI Action, I tried selecting Key after starting with AutoInput.

After that, I then can select Configuration, which brings me to a Key Event Options screen.

On that screen, I can select Keys, Key Action, and Manual Key Codes.

I select Keys, and then I select Back.

I then select Key Action, but all I'm offered is All, Key Down, and Key Up.

No long-press options are offered.

Rich D

unread,
Aug 25, 2023, 6:23:00 PM8/25/23
to Tasker Google Groups Post


On Fri, Aug 25, 2023, 5:09 PM Soudane GMTA <gmta.s...@gmail.com> wrote:
OK, I'm sorry. I was incorrectly working in Tasks, not Profiles. I should have known better.

Anyway ...

In Profiles, I select Event.
Then I select Plugin.
Then I select AutoInput.
Then I select UI Action.

Then, I get to a screen labeled Event Edit upon which I can select Configuration.

I select Configuration, and the only items offered to me are Action Types and Element Text.

So, I select Action Types.
Then, a menu comes up in which I can select Clicks, Long Clicks, Input Element Focused, and Input Element Focused Lost.

I first try Long Clicks, but it just comes back with the AutoInput UI Action menu, in which I can select either Action Types or Element Text.


 

You were correct at this point... The next step is to select 'Element Text'  and type in   

back

That is what identify's the Back Button.

Now just back all the way out of tasker with the back button to save your data and long press the back button... 




Soudane GMTA

unread,
Aug 25, 2023, 10:38:20 PM8/25/23
to Tasker
Aha! Never knew that the back button had an element name that I could reference.

Thank you for your help and for all your patience! This works!

Soudane GMTA

unread,
Aug 25, 2023, 10:44:49 PM8/25/23
to Tasker
Oh! One more question: how do I adjust the long-press time interval that AutoInput uses? I'd like to make it a bit longer than the default.

I can't find any setting within AutoInput which controls this long-press duration.

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages