dekuNukem / duckyPad

Do-It-All Mechanical Macropad
MIT License
1.2k stars 168 forks source link

How end an infinite loop? #150

Closed asd-ez closed 9 months ago

asd-ez commented 9 months ago

I need to use an infinity loop e.g.:

WHILE TRUE
    LMOUSE
END_WHILE

How can I end it by the next click by key? I try like this:

LOOP1:
WHILE TRUE
    LMOUSE
END_WHILE

LOOP2:

What will I need to write in LOOP2?

dekuNukem commented 9 months ago

Probably something like this:

VAR $k = 0
BCLR
WHILE $k == 0
    RMOUSE
    DELAY 50
    $k = $_READKEY
END_WHILE

it press the mouse button while checking if a key is pressed in the loop. if so, it exits the loop.

asd-ez commented 9 months ago

@dekuNukem Thanks for your help!