how can start macro when press key and stop when don't press

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
luca1974wow
Newbie
Posts: 15
Joined: Sat Dec 12, 2009 11:20 pm

how can start macro when press key and stop when don't press

Post by luca1974wow » Sat Dec 12, 2009 11:34 pm

How can i start macro when i press a key and stop macro when i finish press that key

example
when i click F8 the mascto strat

Label>startmacro
send>a
Goto>startmacro


when i stop press key F8 i want che macro stop

Help me please and sorry for my english

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sun Dec 13, 2009 12:45 am

I'd use OnEvent>Key_Down. Look up OnEvent in help.

Code: Select all

//Use Shift + Esc to close this macro
//F8 key = VK119
OnEvent>Key_Down,VK119,0,MainMacro

SRT>MainMacro
  send>a
  Wait>0.01
END>MainMacro

Label>IdleLoop
  Wait>0.01
Goto>IdleLoop

luca1974wow
Newbie
Posts: 15
Joined: Sat Dec 12, 2009 11:20 pm

Post by luca1974wow » Sun Dec 13, 2009 10:37 am

thanks it works

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