left-click only

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am

left-click only

Post by deebee » Thu Sep 23, 2010 6:49 pm

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.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: left-click only

Post by bn » Thu Sep 23, 2010 7:23 pm

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

deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am

Re: left-click only

Post by deebee » Thu Sep 23, 2010 8:12 pm

Ah, that makes sense!

Thank you!

Post Reply