rightClick [Solved]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

rightClick [Solved]

Post by atout66 » Wed May 07, 2014 4:14 pm

Hi to all,

Sorry for such a question, but I don't find the answer in the research area.
How can I manage the right click on a control in LC ?

I tried from the dictionnary:

Code: Select all

on mouseUp 3
but I get a compilation error. However, I can read this in the dictionnary:
mouseUp mouseButtonNumber
Parameters:
The mouseButtonNumber specifies which mouse button is pressed:
1 = left one (for short)
2 = middle one
3 = right one

Any idea around ?
Thanks in advance, Jean-Paul.
Last edited by atout66 on Wed May 07, 2014 5:26 pm, edited 1 time in total.
Discovering LiveCode Community 6.5.2.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: rightClick

Post by dunbarx » Wed May 07, 2014 4:43 pm

Hi.

"mouseup" is a message. It is sent when the user clicks on a control, and releases the mouse while still over that control. It passes a single parameter. Try this in a test button:

Code: Select all

on mouseUp var
   answer var
end mouseUp
Try both buttons when clicking.

Now you can do this sort of thing:

Code: Select all

on mouseUp var
   if var = 1 then doLeftStuff
else if var = 3 then doTheRightStuff
end mouseUp
Craig Newman

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: rightClick

Post by magice » Wed May 07, 2014 4:44 pm

There might be a better way, but i have always done it like this

Code: Select all

on mouseUp x
switch x
case 1 
   answer "left"
   break
case 3
   answer "right"
   end switch
end mouseUp

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: rightClick

Post by atout66 » Wed May 07, 2014 5:25 pm

Ah ! I got it :wink:

Thanks to both of you.

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

Post Reply