associate a hotkey sequence to a "label button" Thread last updated on 2007-11-20 14:12:06

Posted by member 380556 on 2007-11-18 13:43:39

Hello,

( forgive my poor expression ^^" )

-> Briefly, there is no plugin to control Aimp, so i search to send key combination :
Pressing 'play' label button would send 'ALT+P' by example
- jkey seems only able to receive/define hotkeys
- gandharva, dynamp, etc.. are not designed for Aimp

Posted by member 1 on 2007-11-18 14:45:20 link

I believe you want to use a label to send a key combination. I believe there is a module out there called like Remote or something similar that you will need to use. Try reading up on it. If I remember correctly there is an example in the Code section of the forums.

Posted by member 256241 on 2007-11-18 19:37:29 link

Typein module allows you to virtually call keyboard presses... I don't know if it works at a level compatible with application hotkeys...


I want to make a button to tell Synergy to switch screen, have any of you who have used Synergy managed this?
*looks at DeViLbOi*

Posted by member 380556 on 2007-11-18 21:27:51 link

thanks for the replies, at first view, Remote should be what i'm looking for... i will work on this later (..time to work ^^' )

Posted by member 1 on 2007-11-19 07:20:44 link

xanmolbjerg: err...never had the need actually. I just bump my trackball as if I were playin golden tee and roll over to the next screen.

Posted by member 380556 on 2007-11-20 10:10:58 link

I tried to use remote-1.02 but i have a little problem :
Actually, 'remote' doesn't send hotkey Id but menu Id to the process we choose and, contrary to WMP, the player used in the example, the main process of Aimp, TAIMP2Main, doesn't have a Menu with Playing options. :s
TAIMP2Main only proposes its button to control the music : there is a menu with Playing options but this process doesn't have a name so i don't how to reach it. :'(

Otherwise, i know the hotkey Id used by the Aimp2 main process... ^^;

----

Typein, which allows key sequence/combination, isn't able to reach a background application (it is used with litestep hotkey to associate, by example, "ALT+L" to [ type , press 'TAB', type , press 'Return' ].

Posted by member 380556 on 2007-11-20 14:12:06 link

I have reached my objective !! ^^

I use the module 'SendMessage' (http://www.shellfront.org/modules/sendmessage-1.0.zip). It is a "Litestep module or win32 executable that wraps the SendMessage windows api call".
Thanks to this, i simply send the hotkey combination to 'AIMP2': "it sends the given message to a window described by the given Window class and title". (At least one is needed actually)

In my case (AIMP2, CTRL+ALT+P for Play/Pause):
ampPlay_OnLeftClick !SendMessage "" "AIMP2" 786 104 5242883

where 786 is the decimal value of WM_HOTKEY, 104 the one of wParam($68) and 5242883 the one of IParam($00500003).
I found wParam and IParam with Spy++.

I still need to understand where those values come from but it works ^^

PS: i believe the WM_COMMAND message doesn't work again because the parameter is not a menu index of AIMP2 main object.

Edit:
(+) i just learn that :
-the wParam is the Play/Pause command
-the IParam is the value of the hotkey combination and is not required
:]
(+) even if the IParam is not required, a key combination must be associated with the action we want to use. Otherwise, it does nothing ^^'