macro exe. that I want to (run) based on a keyboard input...

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Shel

macro exe. that I want to (run) based on a keyboard input...

Post by Shel » Sun Nov 28, 2004 5:41 pm

:idea: Hello
I have a macro exe. that I want to (run) based on a keyboard input of(W#T) case-sensitive, I’ve been told I have to do a second Macro that’s a (listener) and it execute the main Macro, all I can figure out is it has something to do with making a keyboard recording.

Does any body have a script that waits for a keyboard input and then excutes a main macro or tell me how I can do it and can I have both in the System Start-up file?

Thanks, Shel

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Nov 28, 2004 6:52 pm

Something would need to be running ALL the time and responding to keyboard shortcuts and then executing your macro when the shortcut is issued.

Macro Scheduler does this. So you could install Macro Scheduler on the target machine and set up a macro to respond to the shortcut and run the .exe. But I'm guessing you don't want to use Macro Scheduler or you wouldn't be asking this question. If you do want to use Macro Scheduler create the macro and assign the hotkey to it in macro properties.

Another way is to use Windows Shortcuts. Windows already gives you the option of assigning a hot key to shortcuts. So the simplest thing to do is just make a shortcut for your .exe on the desktop and in the properties for this shortcut (right click on it and select properties) assign the appropriate hot key.

I think this option is far more efficient than having some other macro or program running all the time wasting resources just to respond to a hotkey when Windows already does this.
MJT Net Support
[email protected]

Shel

keyboard inputs W#T to act as hotkeys

Post by Shel » Sun Nov 28, 2004 7:07 pm

Thanks but I need the keyboard inputs W#T to act as hotkeys (ie) capital W then # and then capital T, must be case-sensitive. The shortcuts and Hotkeys are not what I’m look for because my Macro is an exe on a target computer and I need the Macro to also be in the System Start-up folder so it starts when the computer booted.

Thanks, Shel

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Nov 28, 2004 9:52 pm

Hmmm .. Short of building a dedicated piece of software to do this I can't imagine it is possible. I would have thought it is also quite undesirable and hard to imagine how you could do this without causing chaos!

However, perhaps a keyboard mapping tool will help you. Search google for keyboard mapping tools. In any case whatever method you use will require something to be installed on the target machine.

As for running your macro on startup, this is easy - just put a shortcut to it in the Startup program group.
MJT Net Support
[email protected]

Shel

Post by Shel » Sun Nov 28, 2004 10:57 pm

Thanks tech support --- I'll keep you posted on my findings.

Shel

Shel
Newbie
Posts: 8
Joined: Mon Nov 29, 2004 1:00 pm
Location: Providence RI

keyboard inputs of W#T

Post by Shel » Tue Nov 30, 2004 1:42 am

I’ve been all over the place looking at AutoHotkey, Keyboard Express, Keyboard Mapping and trying to expand my Hotkeys or use a hotstring but I don’t want a separate application or program.

I'd like make my Macro to execute with the keyboard inputs of W#T

Or even another Macro that waits and listion for the inputs of W#T and executes my Macro.

Did I miss something??? Even if I have to pay somebody that ok.

401-231-3825

Thanks,
Shel

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Nov 30, 2004 8:34 am

Hi,

Ok, I'm not quite sure why you'd want to do this, but the following script does it for you:


//interval is max allowed number of seconds between each key press
Let>interval=2

VBSTART
VBEND
Label>start
VBEval>Timer,sttime
WaitKeyDown>W
VBEval>Timer,ftime
Let>wtime=sttime+interval
If>ftime>wtime,start
Let>sttime=ftime
WaitKeyDown>#
VBEval>Timer,ftime
Let>wtime=sttime+interval
If>ftime>wtime,start
Let>sttime=ftime
WaitKeyDown>T

MessageModal>Done

Goto>start


Try this script on it's own first. The longer the interval is set to the longer you can wait between each keypress (W,#,T) for it still to work. 2 seconds seems to be a sensible amount of time. When you press W then # then T it will pop up a message saying Done and then start over. Replace MessageModal>Done with your script code, or a call to another macro or Run to an exe.
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Nov 30, 2004 10:49 pm

:!: I can't believe that I didn't recall ever seeing WaitKeyDown command before!.
I thought maybe it was just in the last release and I missed it.
Digging deeper I see that it has been around since Sept 2000! :oops:

Hmmm, WAKE UP BOB! :twisted:
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts