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

Search This thread

agentdr8

Senior Member
Mar 4, 2007
3,648
1,896
Cowtown, CA
++++ 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 :D

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):

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.
 

Attachments

  • mtc-keys-2.6.apk
    383.3 KB · Views: 5,466
Last edited:

tmiller101

Senior Member
Nov 12, 2010
119
34
Savannah
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 ----------

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/and...app-modding-radio-music-movie-kld-jy-t3217197

It is better, don't know if it will work for you.
 
Last edited:

doctorman

Senior Member
Feb 16, 2010
943
288
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
 

Attachments

  • mtc-keys-2.5.apk
    382.5 KB · Views: 284
  • Like
Reactions: WestlakeSt

DRidilla

Senior Member
Feb 6, 2015
56
8
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.
 
  • Like
Reactions: WestlakeSt

WestlakeSt

Member
Nov 9, 2015
14
2
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
 
Last edited:

agentdr8

Senior Member
Mar 4, 2007
3,648
1,896
Cowtown, CA
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.
 

WestlakeSt

Member
Nov 9, 2015
14
2
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.
 

ktibor69

Senior Member
Nov 14, 2014
320
50
Tata
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.
 

robertut

Senior Member
May 11, 2007
284
48
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?
 

tmiller101

Senior Member
Nov 12, 2010
119
34
Savannah
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.
 

WestlakeSt

Member
Nov 9, 2015
14
2
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??? :confused:
Its a bit odd but doesn't bother me to much luckily.
 

robertut

Senior Member
May 11, 2007
284
48
How to disable activity?

I'm trying to replace my play/pause button function with bluetooth app like this:
app_3=com.microntek.bluetooth
It starts the bluetooth app, but it also starts playing the music through it, and also starts Music player app in the background ocasionnaly. I don't want any of that.
All I need is to start the Bluetooth phone app, in order to make calls. Just like I was able to remap DVD button to something else.
Any idea?
 

lotherius

Inactive Recognized Developer
Jan 12, 2009
2,178
612
Houston, TX
Google Pixel 6
Tried the Carservice app on my KLD rom. Crashed when I hit clear log, and never shows any key codes.

Need to get this working as my radio has NO hardware home or back button, and trying to swipe from the top is almost impossible thanks to the raised bezel.
 
Last edited:

Mr Bigglesworth

Senior Member
Jul 23, 2013
293
42
Hi all,

Thanks for all info on this great app. I would like to change two of my hard key settings:

I would like to change my EQ setting to instead of cycling through the default EQ profiles , to take me to the fader screen inside of amp settings.

I would also like to change my SETUP button to cycle between the (a) Setup screen and (b) as if pressing the Home button.

I have logged my buttons as 49 for EQ and 74 for SETUP. And I think I want action commands. But I am not sure what is the action to get to the fader screen within the Amp settings; i.e. action_49 = [??]

And I am not sure if I can cycle by pressing a button more than once, or what is the setup screen command to insert? i.e. action_74 = home [but then ??]

Help much appreciated!


But at this point I am a bit stuck as I do not know how to tell what command would take me to the the fader screen or is the
 

agentdr8

Senior Member
Mar 4, 2007
3,648
1,896
Cowtown, CA
And I am not sure if I can cycle by pressing a button more than once, or what is the setup screen command to insert? i.e. action_74 = home [but then ??]

I don't think mtc-keys can cycle between different actions/apps/activities from a single remapping.

As for the Poweramp EQ, you'll need to figure out what the activity is named within the package. Give Package Explorer a try and see if it lists the activity. Then use that in mtc-keys.ini as activity_##=package_name/activity_name
 

WestlakeSt

Member
Nov 9, 2015
14
2
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.

Yes you can. From my recent experience shouldnt need LLama app.

First you need to find out the key codes of the hard buttons you want to use with the CarService app.

Install XposedMTC and in this app's settings change the preferred music app to Poweramp

Add the following lines to your mtc-keys.ini file (replacing xx with the code for the hard button you want to use)

activity_xx=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Music
activity_xx=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Radio

Good luck :cool:
 
  • Like
Reactions: ktibor69

ktibor69

Senior Member
Nov 14, 2014
320
50
Tata
Yes you can. From my recent experience shouldnt need LLama app.

First you need to find out the key codes of the hard buttons you want to use with the CarService app.

Install XposedMTC and in this app's settings change the preferred music app to Poweramp

Add the following lines to your mtc-keys.ini file (replacing xx with the code for the hard button you want to use)

activity_xx=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Music
activity_xx=com.dr8.xposedmtc/com.dr8.xposedmtc.activities.Radio

Good luck :cool:

I tried your solution.
I edited my used mtc-keys.ini, but now does't work the MTCkey function. I'm using version 1.2. Until I used perfectly mtckey function: DVD button was remapping to iGo.
I did only: I made new mtc-keys.ini file and replaced the old mtc-keys.ini file and reboot the HU.

What did I do wrong?

Edit: In the morning the MTC-keys function is work well.

But the offer solution doesn't work (rotary radio/poweramp).
Did you try your solution? Which version of the MTC-keys did you use?

Edit2:
I installed the latest v2.6 MTC-keys. And now your solution works perfectly.

Many thanks!
 
Last edited:

Mr Bigglesworth

Senior Member
Jul 23, 2013
293
42
I don't think mtc-keys can cycle between different actions/apps/activities from a single remapping.

As for the Poweramp EQ, you'll need to figure out what the activity is named within the package. Give Package Explorer a try and see if it lists the activity. Then use that in mtc-keys.ini as activity_##=package_name/activity_name

So I was playing around with mtc-keys, found a couple of interesting things.

You can cycle in a limited fashion, e.g. I had:
"action_74 = home
action_74 = apps"

And this worked as cycling between home and apps depending on what was last pressed.

I then tried:
"action_74 = home
app_74 = com.android.settings"

And this didn't work - it would only go to the settings menu. So it seems that when you select two 'actions' it can cycle, but when you mix an 'action' and an 'app' it wouldn't work. It also doesn't cycle if you have several apps to the same key - it just seems to use the last set app.

Also - does anyone know how a quick way to restart mtc-keys without switching off and on the unit (as it is taking me ages to try different permutations otherwise!).
 
Last edited:
  • Like
Reactions: doctorman

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    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 ----------

    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/and...app-modding-radio-music-movie-kld-jy-t3217197

    It is better, don't know if it will work for you.
    6
    ++++ 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 :D

    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):

    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.
    3
    latest mtc-keys is version 4.1
    http://4pda.ru/forum/index.php?showtopic=704299&st=0#entry41212085

    Someone with 4pda please post the download link.

    Here you go:

    Code:
    xposed-mtc-manager
    Version 1.1 - Added an alternative screensaver;
    Version 1.2 - Added a quick start user services.
    Version 1.3 - Added redesignation obd-devices;
    Version 1.4 - improvements for renaming obd-devices;
    version 1.5 - set the program list to toggle the MODE button;
    Version 1.6 - bug fixes;
    Version 1.7 - small changes in the call screen saver;
    Version 1.8 - Changes in the restoration of sound radio;
    Version 1.9 - the latest start off running program, correction of errors;
    version 1.10 - bug fixes when disconnecting run the latest software, time synchronization using GPS;
    version 1.11 - the last running program does not start after the winding of the auto with the included PG when setting enabled clear_last_app;
    version 1.12 - the care GU sleep remembers the last running program;
    Version 1.13 - Added ability to enable w-fi at the start.

    Code:
    mtc-keys
    Version 1.1 - fix minor bugs;
    Version 1.2 - Support for Android 4.4;
    Version 1.3 - Changed the algorithm return from the called program;
    Version 1.4 - The algorithm of the program call, adds support for the volume change of the speed programs;
    Version 2.0 - Added options call: action, activity, intent;
    Version 2.1 - Added the ability to take a configuration file with external_sd;
    Version 2.2 - Added ability to renaming the button code via a variant event;
    Version 2.3 - Fix for Android 4.4;
    version 2.4 - in the case of read errors configuration file, it is read after mounting external card;
    Version 2.5 - improved stability of the program;
    Version 2.6 - Added action sleep, reading algorithm modified configuration file;
    Version 2.7 - Removed support for Android 4.2, the configuration file must be located only on the outside of the map, made code optimization;
    Version 2.8 - Added options for the call: media, keyevent, command, changed activity processing algorithm;
    Version 2.9 - Added action sreeenoff;
    Version 2.10 - Added ability to read the settings after mounting external card;
    Version 2.11 - Added ability to call an internal function without parameters;
    Version 2.12 - Changes in version call media;
    version 2.13 - bug fix in the event the call option;
    Version 3.0 - Treatment of double clicking;
    Version 3.1 - bug fixes;
    Version 3.2 - bug fixes;
    version 4.0 - set of button presses for different applications;
    Version 4.1 - improvements.
    3
    I've never heard of a module called xposed-mtc-poweramp. What makes this module?

    Module xposed-mtc-poweramp to display PowerAmp player tag in the modified screensaver.

    attached
    2
    What I want to do is using mtckeys change a key to mute all apps, open google (like saying OK GOOGLE) and to be able to say CALL "contact name", or NAVIGATE TO WORK which already works but not the calling, and after call ends unmute whatever app was muted.

    I tested ok google and it mutes propperly, so all i need is for it to dial on phone from my google contacts but my bluetooth app doesnt sync and i dont have contacts on my radio.



    Sent from my SM-N910T using Tapatalk

    Oke if your bluetooth app does not work there is a workaround. Load your contacts in a google account, or use the same google account as your telephone is using and put it in your Hui. Then download the app headunit en select "enable call from android" and select / download true contacts app.

    If you connect this app i made to a button like this in mtckeys.ini : app_69 = sxp.ksu.nan it will work. It mutes all the music which is playing. If you want to call by voice you have to download the app i mentioned before. Download it and enable the function that you can use voice dailing by oke google.

    Reboot

    After the reboot open the true contact app. You see that all your contacts are in this app. Press the button you mapped my app. It opens google voice search. Say call "name of the contact" and it will call your contact if your telephone is connected to Bluetooth. You will get an error message that there is no network but you can ignore that.

    google voice app
    https://drive.google.com/file/d/0B9a-tOFUEeEBeDFKWWlHaGNNdFk/view?usp=sharing