2
votes

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

1 Answers

3
votes

Have you checked out #If? Thy this:

#If ( toggle = 1 )
LButton::
   ;do code
Return
#If