Page 1 of 1

Is there a way to send key stroke from MC

Posted: Dec 09 2015
by arjfca
Hello

Is there a way to emulate key stroke using MC? Will look to send key combination to activate an AutoHotKey command.

Martin

Re: Is there a way to send key stroke from MC

Posted: Dec 10 2015
by evdl
Hello Martin,

Maybe you can use the ShellExecute function.

Make an exe or bat file with AutoHotKey of the actions you want AutoHotKey to take. Let's name it SendKeyStroke.bat. Place this in a directory of your choice, but for the example in C:\

Then make an indicator with the trigger code to open the exe or bat file.

And use this:

Code: Select all

//Your trigger code in PLE, for example:
If close > close[1]
then begin
once ShellExecute("open", "C:\SendKeyStroke.bat");
end;
The indicator will run the .bat or exe file and the AutoHotKey program will take your required actions.

Import the attached function first (this is supplied sometime ago by MC in another post)