Page 1 of 1

left-click only

Posted: Thu Sep 23, 2010 6:49 pm
by deebee
Searched the docs and forum but I'm still confused:

Code: Select all

on mouseUp 1
gives an error and:

Code: Select all

on mouseUp
if mouseUp is 1 then
blah blah blah
doesn't throw and error, but also doesn't seem to execute the rest of the code in the script.

I'm going to try a switch next instead of nesting my ifs.

Re: left-click only

Posted: Thu Sep 23, 2010 7:23 pm
by bn
Dennis,

the system sends a parameter with the mouseUp message that indicates whether it is left, middle right.

Code: Select all

on mouseUp pWhatButton
   switch pWhatButton
      case 1
         beep
         break
   end switch
end mouseUp
pWhatButton is a variable that I made up to hold the parameter that comes with the mouseUp message, i.e. 1,2, or 3. From there you can do your switch as in the code

regards
Bernd

Re: left-click only

Posted: Thu Sep 23, 2010 8:12 pm
by deebee
Ah, that makes sense!

Thank you!