yashsingh1/xdaforums huggingface dataset:
[MTCB Software Development] TT_Vert:
Ok then dumb question. I open carservice, clear log, press button and then there is a log somewhere or does the button info just display in the left pane there? When i hit a button i see nothing and when I clear log it crashes so I don't know if I'm just clueless or what lol.

Dave
[MTCB Software Development] jakejm79:
I've always used logcat to verify the key codes:

In terminal emulator:

su
logcat | grep mtc-keys

If you press home or back it will likely exit out of terminal emulator, but you can go back in and continue viewing the logcat. Also I don't know if its necessary to run it has su, but it doesn't hurt.
[MTCB Software Development] TT_Vert:
Ok I ran logcat from adb wireless so I could watch it from my pc. However when I press the power key it looks like it runs a shutdown command, well about 70 lines of it so I'm unsure where to look. I hope to remap the power key. I'll go through the output as i pasted to a txt file but is there a particular line I'm looking for?

Thanks

Dave
[MTCB Software Development] Warmwasser:
Have you had any success yet?

I have the same problem, that i don't know how to overlay the next/previous play/pause knob.

I know the keys:

59 = next

58 = previous

3 = play/pause

Thought i could call intents like intent_59=CMDNEXT (Command from here: https://android.googlesource.com/pl...c/com/android/music/MediaPlaybackService.java)

But i don't think that this will work. I listen to music with RocketPlayer and everytime i turn the right knob (for skipping tracks), the original music app starts to play and skip (i have a joying 8" touchdisplay with rooted stock rom). Now you're listening to two tracks at once :D

Can someone tell me, how to use Intents, and if there is one to control music?

Or should i have a look to RocketPlayer with a package explorer and watch out for activities for next/previous and play/pause?

Thanks
[MTCB Software Development] jakejm79:
What you want is

Media_59=next

Media_58=prev

Media_3=play

Also I found that you need to disable the default music app (not the MTC Music app, the on called music with a icon that looks like a blue/gray speaker), just do that under Apps>All>Disable.
[MTCB Software Development] markastor:
Hi!

My volume knob was broken, so I would like to remap the tune knob to adjust volume globally.

It's not really clear what I should write at mtc-key.ini

Vol. down: 27 (New would be: 58)

Vol. up: 19 (New would be: 59)

Any help should be appreciated.
[MTCB Software Development] Tumke32:
Mr Bigglesworth an off topic question. You have the same MX device like me. My question is is your canbus working correctly? I mean, when you close a door do you get a notification on the screen, same for the climate control etc? Can change your steering wheel buttons in the settings menu? All of these things do not work on my device. The only canbus related thing which work are the steeringwheel buttons, but i can't change them in de settingsmenu, in mct-key offcourse i can change them.
[MTCB Software Development] Mr Bigglesworth:
Same as you Tumke I'm afraid. You're post has reminded me I need to get that apk I'm using for voice dialing...
[MTCB Software Development] Warmwasser:
Thank you, that almost worked! "next" does not work when i turn the knob to the right. Anyway as i don't need play/pause, i put media_3 on next (push the knob).

Maybe i'll give it a try tomorrow (i uninstalled original music app, maybe that setup will work).
[MTCB Software Development] jakejm79:
You want the event command:

event_XX=YY

where XX is the code the physical button you are using and YY is the code of the button you want it be.

So if I understand it right you would have:

event_58=27
event_59=19

---------- Post added at 05:08 PM ---------- Previous post was at 05:07 PM ----------

I'd double check that you have the correct code for the next 'button'.
[MTCB Software Development] markastor:
I tried that, but it doesn't working.

Folder and ini file are at /sdcard/
[MTCB Software Development] Tumke32:
is it possible to map my second round knob to dimm and brighten he screen? Right now it is used for next en previous track ( i never use it)
[MTCB Software Development] jakejm79:
internal_sd (i.e. nand) or external_sd (i.e. physical mSD card).

I found that it only works when in ~/mnt/external_sd/mtc-keys/mtc-keys.ini

---------- Post added at 09:20 AM ---------- Previous post was at 09:14 AM ----------

event_xx=85

where xx is the code for whatever button you want to use.

You wont be able to use it control the brightness slider in Android, but you will be able to step through the preset levels the MTCU uses.
[MTCB Software Development] TT_Vert:
I know this was some time ago but a have a question.

When I map this to a key at the top bar I get a quick flash of the text mymusic but it never actually opens anything. If i hit it again it never does try to open radio but it does show it trying to in logcat. I've got that com.dr8.xposedmtc object and I also have the module enabled in xposed.

Any idea what I'm doing wrong?

Dave
[MTCB Software Development] jakejm79:
What Rom are you on, xposedMTC doesn't work on the latest ones, also did you define the My Radio, My Music, etc apps in the xposedMTC settings?
[MTCB Software Development] TT_Vert:
I knew dimming wasn't working when I talked to the dev, wasn't sure about everything else. I did define my preferred radio/music apps (Actually wasn't it music/video apps you could define?) but there are defaults. I see the button calling to the apps via cat via wireless adb and I also see a brief flash of mymusic at the top left. Would that the typical action in the situation where xposedMTC is on a newer ROM?
[MTCB Software Development] jakejm79:
I thought the issue effected the whole module and not just the dimming part, I know I had issues with bootlooping and resets using the source switching part of it.
[MTCB Software Development] TT_Vert:
That is quite possible, I've now disabled it and will use tasker and teh twilight plugin. Does anyone know if the twilight plugin in a gradual dimming from surise to sunset or if its an all or nothing (IE 30 minutes before sunset screen = 20 and 0 minutes before sunrise screen=100 or can you ramp it from say 100% to 20% between the periods of dusk, sunset, dawn? Or perhaps I just need 3 separate tasks where one takes over after the other? If that later, can that be done fluidly without a span between each task where the screen goes back to default value?

Dave
[MTCB Software Development] Mr Bigglesworth:
Finally got around to uploading my shortcut app, hopefully attaches ok. The only think I have noticed with it, that if you press it once, it launches bluetooth, then the delay and goes to google voice.

The next time it loads bluetooth screen with a number in the phone number field and delays before going to google voice.

The next time it loads bluetooth, but as the number is already there it auto dials it, and it takes you to google voice.

Think I need to build in a delete button hold after going to the bluetooth screen but I don't know how to do that yet...

Also Tumke, did you change the SOM in your Witson unit - how much did you pay for it and where did you get it from?
[MTCB Software Development] Tumke32:
Thanks four post, i will try your app. I swapped my som with a rk3188 from joying. I bought it from doctorman. If you live in US you can buy it for $80 excl. Shipping. I live in the netherlands, i paid €110 incl. Shipping. Service was great and i recieved the som in about 5 days. I payed with PayPal.
[MTCB Software Development] Mr Bigglesworth:
Thanks Tumke, I am considering that for the faster boot and to see if it helps with the Google now crashes. How stable is your Google now?

Also I forgot the ini adjustment. I have it as app69=idg.pnk.fpg
[MTCB Software Development] Mr Bigglesworth:
Hi all,

My steering wheel has a button with a call icon that logs in carservice as button 69. In default state this launches the bluetooth app on the HU. I also have a button on the HU which maps to button 69 and launches bluetooth.

Is there anyway to separate these buttons (e.g. telling the HU button as different to the steering wheel button) as I would like them to do different things?

[I don't think there is, but thought I would ask in case someone had figured this out!]
[MTCB Software Development] mbt28:
Hello,

I modified almost all the keys as I would like to but I have problems with play/pause, next and prev.

I cannot assign universal commands to these keys. I mean I would like use it with spotify for example but they are not working. Is there any way to reach core files for the hardware keys?

My play/pause, next prev dong nothing:

keyevent_34 = 85

app_23 = com.spotify.music

action_32 = apps

keyevent_4 = 129

keyevent_33 = 87

keyevent_42 = 88

app_43 = com.sygic.aura

keyevent_59 = 272

keyevent_58 = 273

event_30 = 49
[MTCB Software Development] TT_Vert:
as an aside, how do you determine what these keyevent will equal? IE, keyevrer_4=129, how do you figure out what 129 is?

Dave
[MTCB Software Development] JEMShoe:
Use a HW SWC.
[MTCB Software Development] Mr Bigglesworth:
Could you expand a bit - is this suggesting some hardware modification to the existing SWC or adding new buttons to my SWC or something else?
[MTCB Software Development] JEMShoe:
It is a generic answer because I don't know what kind of SWC everyone has. If you can reprogram it or modify the HW then it can do what you want.

I designed and programmed my own SWC module last year so I intercept the SWC and send whatever I want to the radio whereas the onscreen button sends goes straight to the app or OS. For example, my MODE button has three functions: back, home and power off, depending on whether I single click, double click or long hold. But I can also make the MODE on the steering wheel do one thing and the headunit MODE do something else.

I think with 5.1 Android on Joying they made it so that it supports long press so then you could assign that to another function, to which you could make MTC-KEY do something else while leaving the regular press to do its original function.
[MTCB Software Development] Mr Bigglesworth:
Not sure can modify the HW, inbuilt and goes through canbus (audi type vehicle)?
[MTCB Software Development] dragon_xda:
hi

My HU's gps card stopped working, which means I have to go with 2 ext card slot which would be ext2

would placing mtc-keys folder in this ext2 work?

thanks
[MTCB Software Development] mbt28:
Hi Dave,

From Android key events page. But it is not working.

.
[MTCB Software Development] TT_Vert:
Thanks for the reply How did you get the key events then?

Dave
[MTCB Software Development] mbt28:
From the link below, just click on the event that you want and then you will have event number.

http://developer.android.com/reference/android/view/KeyEvent.html
[MTCB Software Development] TT_Vert:
Did you get your issue resolved btw?

Can you tell me what this line accomplishes for you? event_30 = 49
[MTCB Software Development] Tumke32:
I have a small problem with my mode button. I assigned "home" to my mode button, but when i press it ones i cannot use my volume jog wheels on my steering wheel. When i press the mode button again (second time) i can use them again. Any idea??
[MTCB Software Development] mbt28:
I dont remember exactly but as far as I remember it replaces event 30 with 49. I couldnt solve my problem yet, I cannot find any info about it. Still next prev play/pause doesnt work. It really annoys me. Does anybody can use media buttons with spotify?
[MTCB Software Development] TT_Vert:
do those buttons work any media player at all? Did you do a logcat to see if you see anything happening?

Dave
[MTCB Software Development] peterkanguchu:
How
[MTCB Software Development] mbt28:
No it is not working with nothing. Anyone knows any solution to have universal play/pause next prev commands?
[MTCB Software Development] TT_Vert:
it's just a key input command.
[MTCB Software Development] jakejm79:
media_xx=play

media_xx=prev

media_xx=next

where xx is the code for the button you want. Keep in mind this will disable them working with the MTC apps, so it wont work for tuning the radio etc. Effectively the button will now issue the android command for play/prev/next and any apps not programmed to accept those wont work.
[MTCB Software Development] mbt28:
Thank you, I will try these. But are there any command for skipping the track back and forth? I would like to use tune knob for that. If I use keyevent it doesnt work.
[MTCB Software Development] jakejm79:
That is what next and prev does, you just have to use the button (knob) code for the tune knob, i.e. one click/turn of the knob would be a key code XX. Like I mentioned previously tho, the knob will only work has a prev/next function, it will no longer tune the radio.
[MTCB Software Development] mbt28:
I see but I want to have skip function like skip the song for 5sec each for example.
[MTCB Software Development] jakejm79:
That isn't a function built into android, you could create a media player that performed that function when it received the next or prev input from the media keys.
[MTCB Software Development] TT_Vert:
Quick question for you guys. Is there any reason a button would not display any info when pressed? I have a SRC button that shows nothing. I would like to reprogram it but i'm unsure w/o knowing its keycode. This is the unit I've got and if anyone could help i'd be forever grateful. BTW I'm using adb shell and using command logcat | grep mtc-keys. Using other programs I don't see anything either. I looked into the Generic.kl file and oddly keys like volume up/down 19/27 in that file don't correspond to their actual functions. Is there some other reference file for these keys i'm missing? If I change the home/Back keys in Generic. kl they do change the button behavior so I know it partially looks to /system/usr/keylayout/Generic.kl

This is the unit if anyone cares

[IMG="Joying"]https://www.carjoying.com/media/catalog/product/cache/1/thumbnail/9df78eab33525d08d6e5fb8d27136e95/u/n/universal_android_5.1.1_lollipop_car_radio_head_unit_7_inch_double_din.png[/IMG]

Thanks Dave
[MTCB Software Development] TT_Vert:
Can anyone add and input to this?
[MTCB Software Development] TT_Vert:
I Played around a bit more and created my own Generic.kl file and it did not allow the SRC button to work at all. I also created a test mtc-key.ini file just like I did Generic.kl w/ every keycode from 1-500 using APPS option to show recent apps on every button up to keycode 500 and oddly it did not effect either the back or the SRC button (It worked on Volume +/-, navi button, home buttons.. Back still functions as back and SRC just doesn't work. Is it possible the MCU controls those two keys directly? If not, can someone possibly tell me if there is some other place these two keys may be defined? It certainly isn't in any .kl file I can find on the unit.

Thanks much guys.

Dave
[MTCB Software Development] royalhawk2002:
Guys , I am on last Malaysk ROM on my RK3066 1026x600 HU. It is a 7" HA2100, without physical buttons. I would like to realize following functionalities, using SWC in following way:

SW left side:

SWC 1= Next track in Audio/Video or Start Search next station in Radio

SWC 2= Cycle between Radio, Music player, Spotify,Nav or on long press activate Google Voice search with possibility to make phone calls via BT

SWC 3= Previous track in Audio/Video or Start Search previous station in Radio

SW right side:

SWC 1= Volume up

SWC 2= Mute on/Off

SWC 3= Volume down

Anyone could help me with a step-by-step procedure to install the necessary Modules/app, to configure and to prepare the MTC-keys.ini file ?

Thank you.
[MTCB Software Development] TT_Vert:
There is a step by step procedure basically in post #2, read it. It appears nobody is around here anymore to offer any input however.

Dave
[MTCB Software Development] Mr Bigglesworth:
Dave, sorry can't offer help but it is odd that it's not recognising the key presses. So is this mctd unit? If so maybe they do thing differently is all I can suggest.

---------- Post added at 09:02 AM ---------- Previous post was at 09:00 AM ----------

Also, does anyone know if you can link a key press to a Tasker task. I've made a task that is dependent on variables, but if you export it as an app then it loses the variables dependency.
[MTCB Software Development] TT_Vert:
no MTCB. I'm wondering if it's an MCU thing, It is a unit that had a full touch screen eventually which I converted to buttons. All other buttons work so it's just a matter of figuring out what exactly is in charge of controlling this key. Being as it's a src it could be the MCU.

Dave
[MTCB Software Development] TT_Vert:
Someone has to have some input on this.
[MTCB Software Development] Mr Bigglesworth:
Hi Dave, have you tried mtc manager, I've just started using that to control my src button and functionality is awesome . Not sure of it will work or not for you and you've possibly already tried it as you are normally more ahead of the curve on these things than I am!
[MTCB Software Development] TT_Vert:
I have but the stock functionality of the button isn't even working so something else going on. Just not sure what.
[MTCB Software Development] Mr Bigglesworth:
If the stock functionality isn't working, then does sound like a bigger issue relating to the hardware.
[MTCB Software Development] TT_Vert:
Yep I agree which is why I was wondering if anyone have any input as if the MCU may be controlling this button and not sending any command through to be picked up by mtc-keys or even logcat.
[MTCB Software Development] gb37270:
despite reading the thread , I still don't know how to determine the code of bouttons...

I need help please

thanks
[MTCB Software Development] pakidermo5000:
read post #14 of this thread.
[MTCB Software Development] gb37270:
I could not because I was using the Car Service app of Playstore , which has nothing to do with that of the forum.

Now that I use the right app , everything works . thank you

:o
[MTCB Software Development] lewman:
Hello there,

Could anyone help me here. I have everything setup but just cant remap the track/volume controls on my steering wheel. I have the codes for the buttons.

I think it should be something like this -

KEYCODE_VOLUME_UP = 46

KEYCODE_VOLUME_DOWN = 45

KEYCODE_MEDIA_NEXT = 2

KEYCODE_MEDIA_PREVIOUS = 4

Where am i going wrong?

Help please :))
[MTCB Software Development] jakejm79:
media_2=next

media_4=prev

event_46=19

event_45=27

Shouldn't be any need to remap the volume controls, you can do that via the steering wheel control setup page (though if your sw controls are via canbus they may not be able to remapped that way).

Also note that changing the media controls means they wont work with the MTC apps (they don't respond to the normal android media commands).
[MTCB Software Development] lewman:
Cheers mate. I'll give it a try tonight. My steering controls are via canbus so this is probably the reason why i couldnt get it working in the past either. Still I'll have another go!

-Lew
[MTCB Software Development] nekmiyev:
Anyone try the screenshot as action?
[MTCB Software Development] jbleasdale:
Has anyone had any problems getting MTC-Keys to work with the Booroondook 4.4.4 ROM?

It worked fine for me on the stock Joying ROM but doesn't seem to work on the otherwise excellent Booroondook ROM.

**Now sorted** - The ini file needed to be on the external rather than internal SD card.
[MTCB Software Development] jbleasdale:
Sorted now - I needed to save the settings folder to my external SD rather than internal.
[MTCB Software Development] Tumke32:
Did anyone managed to get an intent to work? I'm using automate and i want to map the phone screen to a button. The intent from Automate is com.bitspice.automate.PHONE_SCREEN

So i did this: intent_4 = com.bitspice.automate.PHONE_SCREEN i also tried intent_4 = com.bitspice.automate/com.bitspice.automate.PHONE_SCREEN

all these options have no effect.

If i try activity_4 = com.bitspice.automate/com.bitspice.automate.PHONE_SCREEN it goes to the home screen of Automate.

Anyone any ideas?
[MTCB Software Development] paulnorinn:
One of my SW button is set to open "Menu" and it does not show keycode in Car Service App. Anyone know what is generic key code for "Menu" action?

Here is the list of keycode from my SQ button read by Car Service App:

Mode = 2

Vol+ = 19

Vol- = 27

Next = 46

Prev = 45

Home = 57

Menu = ??? <- This is button I want to know keycode so I can edit it in mtc-keys.ini, any help?
[MTCB Software Development] dom_christo:
So, here is my ini

first line opens the recent apps drawer when I press the Mode button.

2nd line I want to launch google voice search / google now. It doesn't however. Anyone know the command / app string?
[MTCB Software Development] Mr Bigglesworth:
I posted on this in this entry here and there is a chain of posts around the which you may find useful.

The second option worked for me, "activity_xx = com.google.android.googlequicksearchbox/VoiceSearchActivity"

Although, subsequently I started using utter! Instead of google for voice searching.
[MTCB Software Development] dom_christo:
Thanks! will give it a go.

on a related note, how did you go with voice dialing? still getting that nag message?
[MTCB Software Development] Mr Bigglesworth:
I've been messing around with 5.1.1 recently and can't get that to work properly - others seem to say it is fine but I can't get details on what they are doing. It's a shame as the voice recognition engine is stronger in 5.1.1, I think because it can run high versions of the google app without crashing.

On 4.4.4 which I will be changing back to soon I think, I got it working pretty well - stable on a old release of google app (I had a thread in the Q&A section that might be worth you lookingup). It all got much better when I overlayed the utter app (which still uses the underlying google app engine) as the main voice portal. This improved offline to a useable level for me. I did get the nag screen, but was going to spend some time soon looking at work arounds when I have 4.4.4 loaded back on it.

I'd like to have a proper go with 5.1.1 and utter, but voice dialling just doesn't seem to work properly (it recognises the contact well and loads up the contact card in the google app, but can't connect the call - it's like it can't find the Bluetooth app. Probably something obvious to someone who has a better understanding of this than me.
[MTCB Software Development] Mr Bigglesworth:
Hi Tumke32. Not in front of my HU and don't have automate on the HU, but as you've helped me with many other questions, thought I would take a quick look at this.

The activity approach definitely isn't going to work because the "com.bitspice.automate.PHONE_SCREEN" is not a designated "activity" when you explore using a package explorer.

I tried on my phone using tasker and automate and got the intent to run, so it does work. Not sure if this is just the way you've written your post here vs what you have in the .ini file, but I think when I have used spaces before and after the "=", it has not worked.

An alternative is to export the tasker intent as an app, load it on the HU and then set the activity to the new app path. Bit of an inelegant solution, but one that would take a few mins to do and hopefully have up and running.
[MTCB Software Development] p10driver:
Hey guys, sorry for my bad english, but i hope you understand me.

My music app is Playerpro and I would like to switch the songs over the Hardware keys, but it won't work. Only on jetaudio works the keys over carservice. So I've installed mtc-keys over xposed and xposedmtc and choose a other music app. Then i created a folder named "mtc-keys" in mnt/sdcard. In the folder i created a Text file named "mtc-keys.ini". In this file i wrote two lines, called

activity_58=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Music

activity_59=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Radio

From this thread on Page 2.

Put all this will not work.

Why it is working in jetaudio but not in playerpro?

I hope anyone can help me.

Greetings Martin