Problem using OnEvent and KEY_DOWN

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
rodwaymore
Newbie
Posts: 3
Joined: Thu Nov 08, 2007 4:51 am

Problem using OnEvent and KEY_DOWN

Post by rodwaymore » Sun Oct 12, 2014 7:07 pm

I just started trying to use the OnEvent and KEY_DOWN commands. I have no problem as long a modifier isn't set on the KEY_DOWN. But once a add the modifier, like Ctrl Alt G, it doesn't work. Adding the key modifier seems to just do weird things. For instance, using the code below, I have notepad open and just running the macroscheduler program. If I don't use the KEY_DOWN modifier for the first line (by changing the "5" to a "0") the script works fine.

If I change it to a 2 (for a Ctrl-G), it opens the "Save As" window for Notepad even though Ctrl G isn't the keyboard commands for Save As in Notepad. (The actual command is Alt-F,A)

If I change it to a 3 or a 4 (for Alt-G & Shift-Alt-G), it opens the Windows Help and Support window even though Alt-G isn't the keyboard commands for Windows Help and Support (The actual command is F1 in Notepad)

If I change it to a 5 (for Ctrl-Alt-G, which is the desired keystrokes), it does nothing at all.

The ultimate goal is to create a set of 22 pre-canned hotkey responses that can be entered into chat windows for people in a help desk environment. Perhaps this is the wrong way to go about it but it seemed the most logical. The Ctrl-Alt keys seemed to be the most logical as they most likely won't stomp on other hotkey combinations.

Any information would be greatly appreciated.

Also....I can't for the life of me find a way to change my password from the system generated one on the forum.

Code: Select all

OnEvent>KEY_DOWN,G,5,CtrlAltG
OnEvent>KEY_DOWN,A,0,AKey

Label>mainloop
  Wait>0.02
Goto>mainloop

SRT>CtrlAltG
        Send>Hello there!
        Wait>1
End>CtrlAltG

SRT>AKey
        Send>how are you?
        Wait>1
End>AKey

User avatar
Meryl
Staff
Posts: 124
Joined: Wed Sep 19, 2012 1:53 pm
Location: Texas
Contact:

Re: Problem using OnEvent and KEY_DOWN

Post by Meryl » Mon Oct 13, 2014 2:34 pm

rodwaymore wrote:Also....I can't for the life of me find a way to change my password from the system generated one on the forum.
User Control Panel (below "Board index" > "Profile" tab > Edit account settings and there you can change it.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Problem using OnEvent and KEY_DOWN

Post by Marcus Tettmar » Tue Oct 14, 2014 2:51 pm

CTRL and ALT are stuck down when the "Hello there" is sent. Try this:

Code: Select all

OnEvent>KEY_DOWN,G,5,CtrlAltG
OnEvent>KEY_DOWN,a,0,AKey
Label>mainloop
  Wait>0.02
Goto>mainloop
SRT>CtrlAltG
    Release ALT
    Release CTRL
        Send>Hello there!
        Wait>1
End>CtrlAltG
SRT>AKey
        Send>how are you?
        Wait>1
End>AKey
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rodwaymore
Newbie
Posts: 3
Joined: Thu Nov 08, 2007 4:51 am

Re: Problem using OnEvent and KEY_DOWN

Post by rodwaymore » Tue Oct 14, 2014 7:36 pm

Wow! Thanks for the quick response!! Works great now.

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