Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

I have a macro that executes infinite loop



goto g1

i would like to detect when a key is pressed, at any moment in the loop

so i can't use the command "wait 0 K ..." because macro would stop at this line waiting for the key to be pressed..

so i need to detect a key press that can happen at any line in the macro! maybe it is not possible ...

thank you for your answer
ifk will work only at the line where it appears in the code, and not at any moment ... Sad
"wait 0 K ..." can wait in other thread.

Copy      Help
mac "WaitForKey_Thread"


goto g1

Function WaitForKey_Thread
Copy      Help
if(getopt(nthreads)>1) ret
wait 0 K F6
shutdown -6 0 "Macro415"
another question about wait command

is it possibe to have 2 conditions (or more) in the wait command, i mean for example:

wait 0 (C 0xFFFFFF 495 115 OR C 0xEEEEEE 120 250)

i guess no, but what can i write so it will work?

Thanks for your help!
you could make two functions running; one waiting for the key the other waiting for colour. then have each function shut-down the original function and the other monitoring function.
An old blog on QM coding and automation.

The Macro Hook

Forum Jump:

Users browsing this thread: 1 Guest(s)