FORUMS
Remove All Ads from XDA

APK to define Touchpoints with Hardware Buttons

11 posts
Thanks Meter: 2
 
By Waffel57, Junior Member on 7th August 2019, 01:35 PM
Post Reply Email Thread
Hey Guys,

i have a general question. Is there a mod or. APK where i can define a point/dot on my Touchscreen and map it to a Hardware Button of the car (e.g. Steering wheel Buttons)?

What i want to Do is, to control the Touchscreen without touching. Seems funny but would be perfect, cause id like the steering wheel buttons.

I am using Android Auto with HeadUnit Reloaded, and switching through music with my Buttons works perfectly. Now it would be awesome to launch Google Assistant through a Button. Inside HUR isnt the Option to map the Assistant. And in my Hal9K mood i tried several Things.

So i thought, i am. 90% Inside Android Auto and the G Assistant Touch Icon is in bottom right corner. So i need a App that points on that Display location and simulate a Touch press, when i press the steering wheel. Is that possible?

Thanks for your time and help

Best wishes
R. Schulz
 
 
7th August 2019, 05:18 PM |#2  
Senior Member
Thanks Meter: 38
 
More
Quote:
Originally Posted by Waffel57

Hey Guys,

i have a general question. Is there a mod or. APK where i can define a point/dot on my Touchscreen and map it to a Hardware Button of the car (e.g. Steering wheel Buttons)?

What i want to Do is, to control the Touchscreen without touching. Seems funny but would be perfect, cause id like the steering wheel buttons.

I am using Android Auto with HeadUnit Reloaded, and switching through music with my Buttons works perfectly. Now it would be awesome to launch Google Assistant through a Button. Inside HUR isnt the Option to map the Assistant. And in my Hal9K mood i tried several Things.

So i thought, i am. 90% Inside Android Auto and the G Assistant Touch Icon is in bottom right corner. So i need a App that points on that Display location and simulate a Touch press, when i press the steering wheel. Is that possible?

Thanks for your time and help

Best wishes
R. Schulz

That is a great idea! There is a way to send touches on the screen. You can do it via command line, e.g. :

input tap 560 960

You can also send key events the same way:

input keyevent KEYCODE_WAKEUP

You can browse in internet for the whole list. To determine the coordinates you can enable debug mode, and there is an option that is called INPUT -> pointer location.
This will display the coordinates on the screen whether you put your finger on.

Now, to map hardware buttons I think there are a couple of applications that let you do that. You can also map the hardware button to the key M to start the assistant. If I remember properly that is the hot key from HUR to start the microphone.

Let me know how it goes, I am also interested!

EDIT: Yet another way is to trigger an intent from the HUR app:

am start -a gb.xxy.hr.mic

There are several apps that let you start intents like tasker.
Am application to map the buttons without requiring root is Button Mapper.

Sent from my ONEPLUS A3003 using Tapatalk
8th August 2019, 10:37 PM |#3  
OP Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by Fgarcor

That is a great idea! There is a way to send touches on the screen. You can do it via command line, e.g. :

input tap 560 960

You can also send key events the same way:

input keyevent KEYCODE_WAKEUP

You can browse in internet for the whole list. To determine the coordinates you can enable debug mode, and there is an option that is called INPUT -> pointer location.
This will display the coordinates on the screen whether you put your finger on.

Now, to map hardware buttons I think there are a couple of applications that let you do that. You can also map the hardware button to the key M to start the assistant. If I remember properly that is the hot key from HUR to start the microphone.

Let me know how it goes, I am also interested!

EDIT: Yet another way is to trigger an intent from the HUR app:

am start -a gb.xxy.hr.mic

There are several apps that let you start intents like tasker.
Am application to map the buttons without requiring root is Button Mapper.


Thanks for that informative and interesting answer. Thats a lot of input for me. I will try some of this stuff in the next days and let you know if it works and whats the best solution for me
12th August 2019, 09:40 PM |#4  
Senior Member
Thanks Meter: 38
 
More
Quote:
Originally Posted by Waffel57

Thanks for that informative and interesting answer. Thats a lot of input for me. I will try some of this stuff in the next days and let you know if it works and whats the best solution for me

The other day while driving I suddenly had a question. Why cannot you use the voice activated trigger! Ok Google, to start the voice commands? That way you don't need to press the voice button.

Sent from my ONEPLUS A3003 using Tapatalk
12th August 2019, 09:50 PM |#5  
OP Junior Member
Thanks Meter: 2
 
More
Toggeling with voice is Okey but often i have to scream or turn volume down. Or say it multiple Times. So a key is much more comfortable to me. My Touchscreen is Not perfectly reachable during driving so steering wheel buttons would be the perfect solution for me 🙈
17th August 2019, 02:41 PM |#6  
OP Junior Member
Thanks Meter: 2
 
More
Hey Fgarcor,

I had some time so investigate the problem. What i have done so far:

Mapping all my Hardware Keys to specific keycodes:

-Google Assisstant - - > 289
-Start Route - - > 288
-Switch Spotify - - > 291
-See Notifications - - > 292
-Route Option A - - > 283
-Route Option B - - > 284
-Route Option C - - > 285

So thats all "Events" i need for android auto. Then i went into debug Mode an locate the coordinates for each section:

-Google Assisstant - - > 925 x 556 y
-Start Route - - > 224 x 450 y
- Switch Spotify - - > 215 x 550 y
- See Notifications - - > 791 x 562 y
- Route Option A - - > 260 x 175 y
- Route Option B - - > 260 x 275 y
- Route Option C - - > 260 x 375 y


So i have all Information that i needed an just have to merged them but i dont know where can i define specific commands. I tried "Button Remapper Pro" but the APK does Not detect my keycodes.
Where can i Set up some command lines? Do i have to install a specific Module in Magisk Manager? Or is there Kind of a console on my rooted Android Radio?

Sorry, i dont understand it for 100% and need your help, Thanks

Best wishes
René
Yesterday, 01:50 PM |#7  
Senior Member
Thanks Meter: 38
 
More
Quote:
Originally Posted by Waffel57

Hey Fgarcor,

I had some time so investigate the problem. What i have done so far:

Mapping all my Hardware Keys to specific keycodes:

-Google Assisstant - - > 289
-Start Route - - > 288
-Switch Spotify - - > 291
-See Notifications - - > 292
-Route Option A - - > 283
-Route Option B - - > 284
-Route Option C - - > 285

So thats all "Events" i need for android auto. Then i went into debug Mode an locate the coordinates for each section:

-Google Assisstant - - > 925 x 556 y
-Start Route - - > 224 x 450 y
- Switch Spotify - - > 215 x 550 y
- See Notifications - - > 791 x 562 y
- Route Option A - - > 260 x 175 y
- Route Option B - - > 260 x 275 y
- Route Option C - - > 260 x 375 y


So i have all Information that i needed an just have to merged them but i dont know where can i define specific commands. I tried "Button Remapper Pro" but the APK does Not detect my keycodes.
Where can i Set up some command lines? Do i have to install a specific Module in Magisk Manager? Or is there Kind of a console on my rooted Android Radio?

Sorry, i dont understand it for 100% and need your help, Thanks

Best wishes
René

Hi Rene,

I don't have the pro version, I just tested on my phone to associate a long press on the volume down button to start the Google assistant and it worked. So I guess for your case you can do the following to associate a key with the Google assistant, I see several options:

- On the main screen select "add buttons". Now that the hardware button is not any of the standard buttons like home, recents, volume, etc that you would find on a phone.
- then press the hardware button you want to add so the application automatically reads the code, on this case one of the keycodes that you sent before.
- associate the action with the button you just pressed, you can associate to:
--- actions: like sending keycodes (only for pro it seems), or intents (actions inside an application that can be started from outside of the application), other typical actions like volume control, home, etc
--- applications: launching one of the installed applications
--- shortcuts: available for some applications to start an action quickly.
- here you can select as action send keyevent and there you can choose to send KEYCODE_M. That is specified by HUR as the key to launch the mic, in your case assistant, that way you are independent of a change in the interface and coordinates.
- you can select also to send a shell command, and there you can write what we discussed before "input tap x y". And replace X and Y with your coordinates.
- you could also select directly the assistant under actions, veggie the last one, but I think that would trigger the assistant on your head unit Android and but in HUR.

I hope it helps, if questions, feel free to ask.


Sent from my ONEPLUS A3003 using Tapatalk

---------- Post added at 02:50 PM ---------- Previous post was at 02:46 PM ----------

Quote:
Originally Posted by Waffel57

I tried "Button Remapper Pro" but the APK does Not detect my keycodes.

Sorry I missed this part, how did you get your keycodes in the first place?

Sent from my ONEPLUS A3003 using Tapatalk
Yesterday, 02:10 PM |#8  
OP Junior Member
Thanks Meter: 2
 
More
Thanks for your reply Basically i opened Hal9K MOD Settings. There is a Option called "remap Buttons". There i can enable "keycodes" so whenever i press a key, the Code will displayed for a few seconds. I also can Change the Button functions from a define keycode list (i am Not able to enter a specific keycode). So i put all the Buttons i want to use to a defined keycode which has no function on my Radio yet.

I downloaded tasker and tried to Set up shell commands. I Used "Input tap x y" whenever the specific keycode Was Red. But it seems, tasker cant read the keycodes? I tried to put in the if statement:

getKeyCode() == 289
Keyevent.getKeyCode() ==289
Input keyevent == 289

And some combimations of that but Google assisstant wont start.
Maybe i have to implement a whole Script for that? Never die amything like that, could be funny 🙈

Thanks for your help so far
Yesterday, 02:13 PM |#9  
OP Junior Member
Thanks Meter: 2
 
More
Shell command from tasker
Attached Thumbnails
Click image for larger version

Name:	IMG_20190818_151241.jpg
Views:	16
Size:	260.4 KB
ID:	4807454  
Yesterday, 02:26 PM |#10  
Senior Member
Thanks Meter: 38
 
More
Quote:
Originally Posted by Waffel57

Mapping all my Hardware Keys to specific keycodes:

-Google Assisstant - - > 289
-Start Route - - > 288
-Switch Spotify - - > 291
-See Notifications - - > 292
-Route Option A - - > 283
-Route Option B - - > 284
-Route Option C - - > 285

Did I understand you correctly? These numbers from above were assigned by you? Or did you read them via tasker?

Sent from my ONEPLUS A3003 using Tapatalk
Yesterday, 03:01 PM |#11  
OP Junior Member
Thanks Meter: 2
 
More
Correct, i assigend them in Hal9K, they were inside the list. I think i cant read them with tasker or i just have the wrong command.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread