3 button mice with Macs.

Richard Gaskin ambassador at fourthworld.com
Mon Apr 30 10:54:09 EDT 2007


Richmond wrote:
> Try this:
> 
> on mouseDown
>   if mouse(1) is down then
>     --hang on a minute---
>     if controlKey() is down then
>       ---do whatever you would normally do with a
> Right Click in Windows---
>       end if
>   else
>     ---do nix----
>     end if
> end mouseDown
> 
> Not as daft as it sounds!
> 
> If you are ONLY writing for MAC you can do away with
> the 'mouse(1)' loop:
> 
> on mouseDown
>     if controlKey() is down then
>       ---do whatever you would normally do with a
> Right Click in Windows---
>       end if
> end mouseDown


Mac OS automatically maps the right-click to Control-click, so all you 
need is:

on mouseDown pButton
   if pButton = 3 then
     -- do right-click stuff

   else
     -- do left-click stuff

   end if
end mouseDown

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list