Page 1 of 1

rightClick [Solved]

Posted: Wed May 07, 2014 4:14 pm
by atout66
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.

Re: rightClick

Posted: Wed May 07, 2014 4:43 pm
by dunbarx
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

Re: rightClick

Posted: Wed May 07, 2014 4:44 pm
by magice
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

Re: rightClick

Posted: Wed May 07, 2014 5:25 pm
by atout66
Ah ! I got it :wink:

Thanks to both of you.

Kind regards, Jean-Paul.