2

I want code to be triggered by the left-mouse-button only if the variable toggle is equal to 1, and otherwise I want the left-mouse-button to work normally.

I tried the following:

LButton::
if (toggle=1) {
  ;do code
}

The problem with the code above is that if the variable toggle is equal to 0 then the left-mouse-button will simply not work.

Even if I change the code to

LButton::
if (toggle=1) {
  ;do code
}
else {
Click
}

then the mouse button will click (albeit a simulated one) but functionality such as dragging will not work.

1 Answer 1

3

Have you checked out #If? Thy this:

#If ( toggle = 1 )
LButton::
   ;do code
Return
#If
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.