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

I have a macro that executes infinite loop

;g1

...


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
#2
ifk
#3
ifk will work only at the line where it appears in the code, and not at any moment ... Sad
#4
"wait 0 K ..." can wait in other thread.

Macro415
Code:
Copy      Help
mac "WaitForKey_Thread"

;g1
;...

goto g1

Function WaitForKey_Thread
Code:
Copy      Help
if(getopt(nthreads)>1) ret
wait 0 K F6
shutdown -6 0 "Macro415"
#5
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!
#6
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)