FORUMS

[XPM] MTC-Keys Button remapping tool - by MVG-V70

3,630 posts
Thanks Meter: 1,876
 
Post Reply Email Thread
Quote:
Originally Posted by Malaysk

++++ Added a module for Xposed from MVG-V70 with Russian Forum (I thank him very much for the good job) mtc-keys, which allows action to remap the buttons radio.

Very nice addition. One less thing on my plate now

I hope MVG-V70 doesn't mind, but for those here that don't have 4pda.ru accounts, I've downloaded the file and attached it here.

It requires a text file named mtc-keys.ini located at /sdcard/mtc-keys/ that contain remapping definitions. From the original post (translated by google):

Quote:


The configuration file must be a redefinition of the buttons on the inside of the map (/ mnt / sdcard or / mnt / internal_sd depending on the version of Android) in the catalog mtc-keys and called mtc-keys.ini
file to download happens when you start the radio.

Example mtc-keys / mtc-keys.ini
app_51 = ru.yandex.yandexmaps

Just in case people aren't clear, this is not my work. I'm just resharing it for those not on malaysk's roms and want to try it out.
Attached Files
File Type: apk mtc-keys-2.6.apk - [Click for QR Code] (383.3 KB, 5060 views)
The Following 6 Users Say Thank You to agentdr8 For This Useful Post: [ View ] Gift agentdr8 Ad-Free
2nd November 2015, 02:23 PM |#2  
Member
Savannah
Thanks Meter: 32
 
More
Quote:
Originally Posted by jacekruf

Im still trying to fight with this mtc-key setup.
Dmesg showing only that key was press and that is screen below is from xposed log.
I just want to change one key from DVD to MXplayer pro.
Module is working fine, xposed as well file is looking good but every time i press DVD button all i got is standard dvd player.
Help.

I had a difficult time myself getting this to work. I looked high and low, and found a little bit of information here and there. So I complied everything I found and put together this tutorial. Hopefully this helps.

mtc-keys 2.5 from developer MVG-V70 on 4pda.ru (a russian site)

Must have access to root
Need to install:
Exposed framework
CarService
AppInfoViewer
mtc-keys 2.5
A root browser

Download and install mtc-keys 2.5
Create the folder (mtc-keys) (no uppercase letters)
The folder must be located in one of the following spots depending on the version of andriod. **It will not work if the mtc-keys directory is in the wrong place**
/mnt/sdcard/
/mnt/internal_sd/
/mnt/external_sd/

To discover the buttons keycode open CarService - clear the log and press a button, its keycode will appear
To discover package name download AppInfoViewer

Create the text file mtc-keys.ini within the folder mtc-keys folder
i.e.
/mnt/external_sd/mtc-keys/mtc-keys.ini
a four line mtc-keys.ini example: (all lowercase)
app_84=com.clearchannel/iheartradio.controller
app_42=com.opera.mini.native
app_3=com.microntek.bluetooth
action_45=apps

MTC Instructions taken from 4pda.ru site:
app_xx = package name
xx-button code, the package name, the name of the package installed program. eg: app_42 = ru.yandex.yandexmaps on the DVD is assigned to the program Yandex If you press when you run the program is already running, it is inactive.

activity_xx = name of the package / class name
xx-button code, the package name, the name of the package installed program, the class name, the full name of the class Activiti.
We aktiviti triggered should be set sign exported = "true", or the present list Navi button is assigned to the call of the main window ES-Explorer.

action_xx = action
xx-button code, the effect is one option from the list: home, menu, back, apps, screenshot.
eg: action_51 = apps button Navi is assigned access the list of applications.

intent_xx = intent
sending broadcast Intents.

event_xx = button code

MY CAR BUTTON MAP
Leftside;
DVD = 42
TV = 73
RADIO = 43
MEDIA = 84
LEFT KNOB/ PUSH = 4
LEFT KNOB CLOCKWISE = 19
LEFT KNOB CCW = 27

Rightside;
PLAY/PAUSE = 3
TRACK DOWN = 45
TRACK UP = 46
NAVI = 51
RIGHT KNOB PUSH = UNDEFINED
RIGHT KNOB CLOCKWISE = 59
RIGHT KNOB = 58

a four line mtc-keys.ini example:

app_84=com.clearchannel/iheartradio.controller
app_42=com.opera.mini.native
app_3=com.microntek.bluetooth
action_45=apps

This changes the behavior as such:
DVD = 42 = OPERA
TV = No change
RADIO = 43 = No change
MEDIA = 84 = IHEART RADIO
PLAY/PAUSE = 3 = BLUETOOTH
TRACK DOWN = 45 = RECENT APPS
TRACK UP = Nochange
NAVI = No change

Hopes this sheds some light.

---------- Post added at 03:23 PM ---------- Previous post was at 03:08 PM ----------

Quote:
Originally Posted by dranny69

Hi I would like some advice if possible , i have just got my steering wheel controls working and i have mapped the volume buttons and track up and down buttons . the volume control is working fine and the skip track buttons are working fine on the stock music player but on any other music player skip track buttons do not work ? is there a music player that is better than the poor stock one that will work with the track up/down buttons ? thanks

Try:
http://forum.xda-developers.com/andr...ld-jy-t3217197

It is better, don't know if it will work for you.
The Following 9 Users Say Thank You to tmiller101 For This Useful Post: [ View ] Gift tmiller101 Ad-Free
11th November 2015, 09:18 PM |#3  
Senior Member
Thanks Meter: 284
 
Donate to Me
More
forum.xda-developers.com/showthread.php?p=63615305&highlight=mtc-keys+2+5#post63615305

Mtc-keys 2.5 from developer MVG-V70 on 4pda.ru (a russian site)

Must have access to root
Need to install:
Exposed framework
CarService
AppInfoViewer
mtc-keys 2.5
A root browser

Download and install mtc-keys 2.5
Create the folder (mtc-keys) (no uppercase letters)
The folder must be located in one of the following spots depending on the version of andriod. **It will not work if the mtc-keys directory is in the wrong place**
/mnt/sdcard/
/mnt/internal_sd/
/mnt/external_sd/

To discover the buttons keycode open CarService - clear the log and press a button, its keycode will appear
To discover package name download AppInfoViewer

Create the text file mtc-keys.ini within the folder mtc-keys folder
i.e.
/mnt/external_sd/mtc-keys/mtc-keys.ini
a four line mtc-keys.ini example: (all lowercase)
app_84=com.clearchannel/iheartradio.controller
app_42=com.opera.mini.native
app_3=com.microntek.bluetooth
action_45=apps

MTC Instructions taken from 4pda.ru site:
app_xx = package name
xx-button code, the package name, the name of the package installed program. eg: app_42 = ru.yandex.yandexmaps on the DVD is assigned to the program Yandex If you press when you run the program is already running, it is inactive.

activity_xx = name of the package / class name
xx-button code, the package name, the name of the package installed program, the class name, the full name of the class Activiti.
We aktiviti triggered should be set sign exported = "true", or the present list Navi button is assigned to the call of the main window ES-Explorer.

action_xx = action
xx-button code, the effect is one option from the list: home, menu, back, apps, screenshot.
eg: action_51 = apps button Navi is assigned access the list of applications.

intent_xx = intent
sending broadcast Intents.

event_xx = button code
Attached Files
File Type: apk mtc-keys-2.5.apk - [Click for QR Code] (382.5 KB, 246 views)
The Following User Says Thank You to doctorman For This Useful Post: [ View ] Gift doctorman Ad-Free
12th November 2015, 12:28 PM |#4  
Member
Thanks Meter: 8
 
More
This might be related a little to this thread, we went from needing a forum to maybe having too many forums haha. There's a way to flip the direction of your up / down in the factory settings, correct? Which setting is that exactly, I can't tell by the labels.
The Following User Says Thank You to DRidilla For This Useful Post: [ View ] Gift DRidilla Ad-Free
14th November 2015, 02:59 PM |#5  
Junior Member
Thanks Meter: 2
 
More
Thanks to everyone above who has posted about the mtc-keys module.
I am gradually getting things to work how I want and have been able to successfully remap my "MEDIA" button to launch my preferred music playing app.

Now a few more issues have come up. I can't work out how to get the play/pause, skip forward and skip back buttons to work in the music app I am using. I have worked out the key codes using CarService but I dont know how to write the entries in the .ini file to use these functions in the app. Any one have any ideas how to do this. I assume it will use the activity_xx or action_xx parameter but how can I find out what these are from my music app (currently trying out Mixzing).

Also, with the stock apps if you were in music player and pushed the radio button (called BAND on my head unit) it would close the music app and open the radio and you wouldnt get both playing over each other. Similarly opening the music app would close the radio. This no longer works, so is there a way I can get it to terminate or close the music app if I push radio button or terminate radio if I launch the music app?

I have searched this a fair bit and havent come up with much and the original post being in Russian isnt helping.

Any help or advice anyone is willing to provide would be most welcome.

Kind regards,
Steve
16th November 2015, 09:57 PM |#6  
agentdr8's Avatar
OP Senior Member
Flag Cowtown, CA
Thanks Meter: 1,876
 
Donate to Me
More
Quote:
Originally Posted by WestlakeSt

Any one have any ideas how to do this. I assume it will use the activity_xx or action_xx parameter but how can I find out what these are from my music app (currently trying out Mixzing).

It depends on how that media player expects commands to come to it. Some use the generic Android media intents, others use app-specific intents. The easiest way to find out is to send generic android intents from a shell (or Terminal). If it responds, then you're good. You can also try sending keyevents for specific keys, and see if it responds to those.
17th November 2015, 01:14 AM |#7  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by agentdr8

It depends on how that media player expects commands to come to it. Some use the generic Android media intents, others use app-specific intents. The easiest way to find out is to send generic android intents from a shell (or Terminal). If it responds, then you're good. You can also try sending keyevents for specific keys, and see if it responds to those.

Hi agentdr8. Thanks for your help (here and in the other thread ). I have now started using Poweramp and the play/pause, next track, prev track hard buttons work fine without any need to use mtc-keys.
17th November 2015, 10:26 AM |#8  
Senior Member
Flag Tata
Thanks Meter: 50
 
More
Can the MTC-keys make that:
I would like to use radio and Poweramp app by pressing hard button rotatory.
- When I listening poweramp and press the Radio button, will be the result: radio start and Poweramp app killed. I made this with rules of LLama app.
- When I listening Radio and press the Media (Poweramp) button, will be the result: Poweramp start and Radio app killed. I didn't kill radio app with Llama app.
17th November 2015, 03:39 PM |#9  
Senior Member
Thanks Meter: 48
 
More
A quick question: since malaysk's latest ROM update, I have to press TWICE a key to work AFTER REBOOT. After that, it works if I press only once, but right at the first keypress, I have to press it two times to work.
Any key.

Any idea what could that be?
17th November 2015, 07:32 PM |#10  
Member
Savannah
Thanks Meter: 32
 
More
Quote:
Originally Posted by robertut

A quick question: since malaysk's latest ROM update, I have to press TWICE a key to work AFTER REBOOT. After that, it works if I press only once, but right at the first keypress, I have to press it two times to work.
Any key.

Any idea what could that be?

I was experiencing that with the stock firmware and still experiencing it now that I'm on Malaysk ROM. However I have noticed that sometimes if I wait a while I don't need to press it twice. So it might be a overworked or working processor problem.

I guess it's good to see someone else with the same issue.
18th November 2015, 06:14 PM |#11  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by tmiller101

I was experiencing that with the stock firmware and still experiencing it now that I'm on Malaysk ROM. However I have noticed that sometimes if I wait a while I don't need to press it twice. So it might be a overworked or working processor problem.

I guess it's good to see someone else with the same issue.

I also experience this issue and I am using stock rom which is now rooted. I have also found like tmiller101 that if you leave the unit for a bit after first booting it doesn't need to two presses to the start to function normally. Could it be something needing to load in the background after boot for the hardware buttons to function???
Its a bit odd but doesn't bother me to much luckily.
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes