OnEvent / Key_Down (Suggestion)

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

OnEvent / Key_Down (Suggestion)

Post by PepsiHog » Fri Feb 18, 2011 6:00 am

v12

Marcus,

Sometimes I want an event to be turned off. Is there a way to undo an OnEvent trigger? If not, could you make this possible?

For example. When numlock is on I want pressing F2 to cause my macro to jump to a srt. But if numlock is off I don't want the trigger. I have tried re-directing the OnEvent, but that causes delay problems.

Maybe it could be...

OnEvent>Key_Down,VK113,0,MySrt,Off

I don't know, you probably have better concepts, but something in that order.

Thanks.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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

Post by Marcus Tettmar » Fri Feb 18, 2011 7:32 am

Right now you need to set a flag. E.g. your OnEvent subroutine could look something like:

Code: Select all

SRT>MyEvent
  If>flag=1
     .. do stuff
  Endif
End>MyEvent
And then if you want to disable the event you set flag to 0 and to enable it again set it to 1.

But the ability to turn off OnEvents is on the wish list.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Feb 18, 2011 10:52 am

OnEvent>Key_Down,VK113,0,DoVK113
You can disable the Key_Down event with:
OnEvent>Key_Down,VK113,0,Null
SRT>Null
End>Null

User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Thanks

Post by PepsiHog » Fri Feb 18, 2011 1:08 pm

Thanks, Marcus for putting that on the wish list.

Armsys, thanks. I'll try that. What I did was have it return to itself, but that caused lag in response. Maybe making the srt Null directly under the OnEvent will help too.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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