Shortcuts for HTC Sense functions? - Touch Diamond2, Pure Themes and Apps

I've been trying to find a way to trigger particular Sense functions by mapping them to hardware keys.
In particular, I'd like to map buttons to play/pause music and skip tracks. Ive looked for command line arguments that will do it, and also key commands that the audio manager might pick up on, but I've had no luck. Might anyone be able to point me in the right direction?

Neocronic said:
I've been trying to find a way to trigger particular Sense functions by mapping them to hardware keys.
In particular, I'd like to map buttons to play/pause music and skip tracks. Ive looked for command line arguments that will do it, and also key commands that the audio manager might pick up on, but I've had no luck. Might anyone be able to point me in the right direction?
Click to expand...
Click to collapse
I know that there is a button emulator floating around (don't recall the name) that allows you to emulate pressing a specific x,y, coordinate on the screen.
Maybe this one....
Here's another thread regarding similar request.

I've made it that far. My issue is how to call the actual play/pause using an application such as that. Maybe a command line argument to manila.exe, or an emulated key press that the audio manager would see and toggle the play/pause.
Both of those sound like they'd work, but I can't find any more information on things such as that.

Related

Anyway to modify the hardware buttons

Is there a way to modify which apps the hardware buttons run?
There are reg keys to change the right softkey. I really want to change the voice dial one though. I never use it, but it'd be so nice to change it to something more useful like a task manager.
Which registry key exactly needs to be changed?
I'd like to be able to hook the two keys which are left and right of the 5-Way Navigation. Actually what are the official names for these keys?
aloshka said:
There are reg keys to change the right softkey. I really want to change the voice dial one though. I never use it, but it'd be so nice to change it to something more useful like a task manager.
Click to expand...
Click to collapse
I tried my best to change the "Voice Command/Voicenote" key at the left side (the one below the volume up/down keys). No luck yet. See the last posts in this thread:
http://forum.xda-developers.com/showthread.php?t=306794
Anyone else knows how to remap this key? And does anyone know how to remap the left- and right Softkeys?
EDIT:
Finally found the right tool for doing this. It's called AE Button Plus and it's great.
You can find it here: http://ae.inc.ru/aebplus.php

Good idea for backlight control

Alright.. as we all know looking at our phones in the bright sunlight is a pain, so I was trying to figure out a good way to control the backlight without having to do too much work. I was thinking that we could assign a hard key to launch an application, and then from there our volume controls or scroll wheel could adjust the backlight. Is there a program that does something similar already?
bombzhome said:
Alright.. as we all know looking at our phones in the bright sunlight is a pain, so I was trying to figure out a good way to control the backlight without having to do too much work. I was thinking that we could assign a hard key to launch an application, and then from there our volume controls or scroll wheel could adjust the backlight. Is there a program that does something similar already?
Click to expand...
Click to collapse
Why not use a plugin?
Or, if you want a hardware button assigned, create a shortcut, .lnk, name it "Backlight.lnk", throw it in the "\Windows\Start Menu\Programs", and there you go!
Edit: Here's the shortcut attached, just make sure you change it from ".txt" to ".lnk"
That didn't work for me.
Oops, forgot to delete the first few words, here it is, should work.
I kept searching around and I came across this:
http://forum.xda-developers.com/showthread.php?t=379270
This worked just fine. I mapped it to my Voice Record button. Now I can just hold the button, and adjust the backlight with my scroll wheel.
Thanks for your help!

? remap green button to speakerphone

I want to map the green "phone" ("send") button to work as speakerphone with long keypress when phone is used, but I can't find any info.
OTOH I notice most ROMs use long press for this button and map usually wireless managers, which would be fine if it would work that way only when phone is not in use (and 'restore' the speakerphone function for long press when phone is in use) but I have not seen such solution yet. Has anyone done/try this?
-888- said:
I want to map the green "phone" ("send") button to work as speakerphone with long keypress when phone is used, but I can't find any info.
OTOH I notice most ROMs use long press for this button and map usually wireless managers, which would be fine if it would work that way only when phone is not in use (and 'restore' the speakerphone function for long press when phone is in use) but I have not seen such solution yet. Has anyone done/try this?
Click to expand...
Click to collapse
Hi,
Deleting Long_Send.lnk might restore original function of long press send key sir,.
Hope it help,.
Regards
Unfortunately, I don't think you can have two different functions based on context. AdvancedConfig has an option to map pretty much anything to the long send.
Garmin said:
Hi,
Deleting Long_Send.lnk might restore original function of long press send key sir,.
Hope it help,.
Regards
Click to expand...
Click to collapse
Thank you, Sir
blue_94_trooper said:
Unfortunately, I don't think you can have two different functions based on context. AdvancedConfig has an option to map pretty much anything to the long send.
Click to expand...
Click to collapse
Well, I was thinking about something more complex than I can do myself, hence my post here.
Idea is to make a small applet which will switch the function of the button based on the processes running (or other ways to determine it) and assigning different shortcut to this button. I.e. when the phone is connected it will assign speakerphone to the "send - long press", when phone is not in use it would redirect "send - long press" to the wireless manager, if you know what I mean (sorry my english); so virtually mapping the "green" button to this app could achieve that, no?
intersted also in your send key LKP!!
-888- said:
Thank you, Sir
Well, I was thinking about something more complex than I can do myself, hence my post here.
Idea is to make a small applet which will switch the function of the button based on the processes running (or other ways to determine it) and assigning different shortcut to this button. I.e. when the phone is connected it will assign speakerphone to the "send - long press", when phone is not in use it would redirect "send - long press" to the wireless manager, if you know what I mean (sorry my english); so virtually mapping the "green" button to this app could achieve that, no?
Click to expand...
Click to collapse
Bump....
I also want exactly the same setup! Great minds think alike!
Your mention about the wireless manager sounds a handy idea also, and I am at present having to use a long keypress on the left hand hardware 'record' button. This is fine, but I also have it mapped to normal press = audio record. But want to use it for something else at some point.The more buttons free the better. To be able to have the sent button act on a long key press to work the speakerphone seems to me like something that should actually be in place by default. I mean, what better way to start the speakerphone!!
I do hope someone is able to shed some light on this, or you manage to pull it off yourself you can count me in to try the fix etc.
PS:: Would a MORT SCRIPT help in this situation I wonder? I am not familiar with MS but sure someone may know a way round it.
Regards
Nick-UK
Thanks for your kind support
I wrote about this year or more ago on another forum, but few responses I got were discouraging at best.
I think if we could do such "app", we could use it for all the buttons and change their "assignments" based on the currently running apps...
With scripts we can do things like rename "Long_Send.lnk" into "Long_Send.disabled" (for example) instantly, and rename it back to "Long_Send.lnk" when i.e. pressed again. But the problem is that I don't know how to "detect" and use it in the scripts what is currently running and discriminate between foreground and background processes that are currently running?
Because what if you have two (or more!) programs that are using the same button assignments but for different purposes and both are running in the same time? say you are on the phone talking - thus long_send is assigned to speakerphone, and you also run (for example) windows media player where you assigned same green button to fullscreen display? The scripts cannot tell which one is running in the foreground by themselves, and (in this example) holding green button could bring the WMP to fullscreen instead of turning on speakerphone. Beforewe use mortscript to "activate" apropiate script, we need to know which process was started last (so - per my example - we would know that the phone was last started and not the WMP, and mortscript would run "speakerphone script for green button" instead of "fullscreen wmp script for green button"... and there is another problem: the phone is always ON on our PocketPCs since boot, and it is running all the time in the background, so it will have to differentiate between phone being active and phone in the "waiting" state...). Apologies if I sound incomprejensible, I tried to make it clearer but I don't know is it less gibberish
to cut it short: I don't think it can be done with simple scripts. But of course I may be wrong.
In theory it should work this way:
1 Long_Send.lnk -> starts our "app"
2 "App" checks what program is currently running on the screen (in the forground, or last started etc)
3 "App" executes apropiate action assigned for this program (i.e. speakerphone for active phone call, or wireless manager for today screen, etc etc)
4 "App" releases/removes/disables the action from previous step and changes it back to the state it was before when the foreground program is closed (i.e. changes back long_send from assignment to speakerphone back to default once the phone call ended)
sounds simple, doesn't it?

Mapping SIP Key

Ok, I searched around for about an hour, and must not be using the right search term or something. Anyway,
I have an HTC HD2, and i'm trying to run gotomypc with it (and pandora). I can run both, but i have to map the hardware button to my input panel in order for it to come up in either application. Thats all well and fine, except i also like the default long press key option that brings up my voice command. (And for those that don't have an HD2, there is only 1 mappable hardware key). So i have to jump back and forth on button assignments to use applications.
So point is, i installed AE Button Plus, and it appears to be able to do the trick, yet i can't find what file to point the assigned long press button too. Where is "input panel"/aka SIP located at/what directory?
Or does someone have an easier suggestion for mapping a previously unassignable hardware key to the SIP?
Thanks in advance!

[PX5] MTCE Button remapping Tutorial for Malaysk / mtce-utils

Hi there,
after struggling around with the mcte utils settings.ini file to remap buttons, I tought I might share what I learned.
This assumes, you have installed xposed, activated the mtce-utils module and placed the settings.ini file at your internal sc card (/storage/emulated/0).
Here's how to remap buttons:
PHP:
[android.microntek.service#keys]
# In this section, you have to put all GLOABL remap functions into. You can use the following ways or remapping:
# note: xxx always stands for the mtc-keycode. If you do not know them, you can use MTCD Tools -> Creata new bnding -> Obtain key sequence to get the key codes.
app_xxx=com.spotifiy.music
#--> this defines to launch any app, e.g. app_257 would in my case launch spotify when pressig OK button.
keycode_xxx = 4
# ---> with the keycode command, you can assign android keycodes. For example "4" is the back button, "87" is media next.
# a full list of android codes can be found here: https://android.googlesource.com/platform/frameworks/native/+/master/include/android/keycodes.h
activity_xxx = com.zoulou.dab/com.zoulou.dab.MainActivity
# --> this is to launch any activity. Always put a pair of app/activity with a slash in between. My example starts the DAB App.
intent_xxx= [any android intent action]
#--> this is to assign an intent. Couldn't test it yet.
keymtc_xxx= yyy
# --> this is used to reassign another mtc key.
[com.microntek.radio#keys]
# to remap buttons within specific apps, create an extra section which contains the app name [B][app.name#keys][/B]
# same as with global remapping, put the codes here as you which to reassign keys within special apps.
Well hope that makes the settings more clear for you.
BR
Christian
I just made some small corrections to the above post and want to share my settings with you:
What did I actually do?
I changed the two steering wheel keys "Mode" and "List" to Keycodes 219 and 4. 219 launches Google Assitant, 4 is to go back. This way, I can easily launch Google Assistand for calls, navigation and spotify, tunein and can minimize if needed.
I assigned keycodes 87/88 to both forward/backwards keys, so that I in most apps can go forward/backward
I assigned my favorite apps to the buttons 1-6, which are DAB, TuneIn, Spofity, FM Radio app, Google Maps and Bluetooth Phone
So I can switch easily between all those apps. As the radio app has its own buttons assigned, here the keys 1-6 are still used as usual.
What doesn't work is the part where I wanted to fix wrong forward/backward keys in radio app. Assigning backward to forward and vice versa leads to a crashing radio app (behaves like non ending loop then)
PHP:
[android.microntek.service#keys]
activity_331=com.zoulou.dab/com.zoulou.dab.activity.MainActivity
keycode_365=4
keycode_276=87
keycode_278=88
keycode_256=219
activity_283=com.zoulou.dab/com.zoulou.dab.activity.MainActivity
app_284=tunein.player
activity_285=com.spotify.music/com.spotify.music.MainActivity
activity_286=com.microntek.radio/com.microntek.radio.MainActivity
app_287=com.google.android.apps.maps
app_288=com.hb.dialer.free
[com.microntek.radio#keys]
keycode_276=90
keycode_278=89
activity_331=com.zoulou.dab/com.zoulou.dab.MainActivity
Hope this helps!
Christian
I can not make settings.ini work, do you paste the file in / storage / emulated / 0 directly or put it in the mtce-utils folder?
Hy @gforums,
thanks for the little tutorial.
Unfortunately, changing the steering wheel buttons does not work.
I am currently using Android Oreo with the Malaysk Rom.
Enclosed my settings.ini
Code:
[android.microntek.service#keys]
keycode_258=87
keycode_316=88
@elavaro19:
as I understand it you have to put the ini file directly into the directory /storage/emulated/0.
BR
gary822
@gary822 I'll try like this, I can not assign buttons for canbus and I want to remap some buttons between them the aux button to home
Dude, this is awesome stuff! Thank you so much for sharing what you learned!
But where can i find out wich key on my sterlingwhel has wich keycode?
kaderekusen said:
But where can i find out wich key on my sterlingwhel has wich keycode?
Click to expand...
Click to collapse
I've used mtcd tools, option to select a new binding and then pressing the key I want to assign. Mtcd tools should show you the mtce key code then.
kaderekusen said:
But where can i find out wich key on my sterlingwhel has wich keycode?
Click to expand...
Click to collapse
gary822 said:
Hy @gforums,
thanks for the little tutorial.
Unfortunately, changing the steering wheel buttons does not work.
I am currently using Android Oreo with the Malaysk Rom.
Enclosed my settings.ini
Code:
[android.microntek.service#keys]
keycode_258=87
keycode_316=88
@elavaro19:
as I understand it you have to put the ini file directly into the directory /storage/emulated/0.
BR
gary822
Click to expand...
Click to collapse
Did you reboot after changing the settings.ini? This is needed. Have you also activated the xposed-mtce-utils module? And checked whether the mtce key codes used are the right ones?
Are you on Malaysk?
I think I may have found the solution to this. I'll post it here if it works.
mattj949 said:
I think I may have found the solution to this. I'll post it here if it works.
Click to expand...
Click to collapse
hello, Any news ?
Thank you very much for this! I was able to figure out how to remap most of the keys on my CAN bus steering wheel controls. I'm now trying to figure out how to find an apps key codes so I can assign them to other keys on the head unit... How did you find out what the key codes are for your DAB key codes in the very last section of the settings.ini?
I have 2 apps I'm trying to figure out. One I'm trying to do is the FM radio app; [com.microntek.music#keys] and would like to make to when I press and hold the "next or previous" buttons that changes the presets, then just a single press will seek the next FM station. Do you know if there is any command lines that can be added to make it use the press and hold of a button? So that a single button can do 2 actions? I've played around with some of the units key study that has the ability to change the units buttons and can assign a single press, and press and hold, but the list of keys that can be assigned is limited.
The other I need to figure out is one button in a special app that tells it's special USB to send a signal to turn on the factory DSP amplifier. That app has button within the app that can manually send the signal, but I can't figure out how to find it's key code. And there is no Activity for it that I can use that I can find. I use an app called QuickShortcutMaker to identify an apps Activities name that it has.
Thanks.
Hey guys,
can any1 please share respectively upload the latest mtce-utils? Can't find them...
Thanks in advance
look on git hub
whitewolf8111 said:
Thank you very much for this! I was able to figure out how to remap most of the keys on my CAN bus steering wheel controls. I'm now trying to figure out how to find an apps key codes so I can assign them to other keys on the head unit... How did you find out what the key codes are for your DAB key codes in the very last section of the settings.ini?
I have 2 apps I'm trying to figure out. One I'm trying to do is the FM radio app; [com.microntek.music#keys] and would like to make to when I press and hold the "next or previous" buttons that changes the presets, then just a single press will seek the next FM station. Do you know if there is any command lines that can be added to make it use the press and hold of a button? So that a single button can do 2 actions? I've played around with some of the units key study that has the ability to change the units buttons and can assign a single press, and press and hold, but the list of keys that can be assigned is limited.
The other I need to figure out is one button in a special app that tells it's special USB to send a signal to turn on the factory DSP amplifier. That app has button within the app that can manually send the signal, but I can't figure out how to find it's key code. And there is no Activity for it that I can use that I can find. I use an app called QuickShortcutMaker to identify an apps Activities name that it has.
Thanks.
Click to expand...
Click to collapse
--> activity_331=com.zoulou.dab/com.zoulou.dab.MainActivity
The keycode from the key I want to assign can be obtained my "mtcd key tool" or in hal9k rom, where you can activate that keycodes are displayed by key press. In my case, key 331 is the "1"-key from my orginal radio.
the app/activity combination can by obtained by the app "package name viewer" that lists you app names / activities of your insalled apps.
I do not know, how you can change behaviour between short and long press.
Also, how to change the behaviour of the keys within an app, is difficult. You can work with Intents, but I am not used to it.
gforums said:
--> activity_331=com.zoulou.dab/com.zoulou.dab.MainActivity
The keycode from the key I want to assign can be obtained my "mtcd key tool" or in hal9k rom, where you can activate that keycodes are displayed by key press. In my case, key 331 is the "1"-key from my orginal radio.
the app/activity combination can by obtained by the app "package name viewer" that lists you app names / activities of your insalled apps.
I do not know, how you can change behaviour between short and long press.
Also, how to change the behaviour of the keys within an app, is difficult. You can work with Intents, but I am not used to it.
Click to expand...
Click to collapse
Thank you for your help! I think I have most of it all working the way I want now, but I will keep playing around with it some more. :good:
@gforums or anyone with the answer, has anybody been able to remap a wireless keyboard/remote? Mainly I'm trying to get the volume and mute to work. I know that the volume is controlled by the MCU and the remote want's to control the media volume which does nothing on our units. I'm just not quite sure how it should be written for the mtce-utils .ini file.
MCU volume up/down codes for MTCE are: 273/281 respectively. And the remote/native android codes for volume up/down are: 24/25 respectively.
has anyone already tried get this running on android 9 (PX5)?
As xposed is needed and in android 9, xposed only can be installed as magisk module, I can't get it working.
So currently I do not know a way to change canbus keys in Android 9.
Anyone of you does?
Best regards,
Christian
Hi,
I'm running android 9, I installed Xposed, but how do you instal mtce-utils ? Can't find them anywhere.
Thanks

Categories

Resources