New topic: 

Help with Secondary Mouse Click on Track Pad

<http://forums.realsoftware.com/viewtopic.php?t=48057>

         Page 1 of 1
   [ 3 posts ]             Print view    Previous topic | Next topic          
Author  Message        mikecotrone          Post subject: Help with Secondary 
Mouse Click on Track PadPosted: Mon Jun 03, 2013 7:02 pm                        
 
Joined: Tue Mar 05, 2013 2:33 pm
Posts: 64
Location: Greensboro, North Carolina                I thought this would have 
been the right code to allow my "secondary click" (two finger click) on my MBP 
track pad. Please point me into the right direction as this works when you 
press/hold control then single click.

Thanks in advance!

Dim base as new MenuItem
Dim ZoomSubMenu as new MenuItem("Zoom")
Dim hitItem as new MenuItem


If IsContextualClick then
  
  if ContextualOverImage Then //Only allow if over a Node Image
  
  if Keyboard.AsyncControlKey or Keyboard.ControlKey then
  
  ZoomSubMenu.Append( New MenuItem("Zoom 275%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 250%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 225%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 200%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 175%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 150%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 125%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 100%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 75%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 50%"))
  ZoomSubMenu.Append( New MenuItem("Zoom 25%"))
  base.Append(ZoomSubMenu)
  
  base.append(New MenuItem(MenuItem.TextSeparator))
  
  base.append(New MenuItem("Bring to Front"))
  base.append(New MenuItem("Send to Back"))
  
  base.append(New MenuItem(MenuItem.TextSeparator))
  base.append(New MenuItem("Delete Node"))
  
  hitItem = base.PopUp(X,Y)
  
  if hitItem <> nil then
    if hitItem.Text = "Delete Node" then
    Me.mRemoveObject(Me.SelectedObject)
    
    elseif hitItem.Text = "Zoom 275%" then
    // 275% Zoom
    me.mObjectZoom(2.75)
    
    elseif hitItem.Text = "Zoom 250%" then
    // 250% Zoom
    me.mObjectZoom(2.5)
    
    elseif hitItem.Text = "Zoom 225%" then
    // 225% Zoom
    me.mObjectZoom(2.25)
    
    elseif hitItem.Text = "Zoom 200%" then
    // 200% Zoom
    me.mObjectZoom(2.0)
    
    elseif hitItem.Text = "Zoom 175%" then
    // 175% Zoom
    me.mObjectZoom(1.75)
    
    elseif hitItem.Text = "Zoom 150%" then
    // 150% Zoom
    me.mObjectZoom(1.5)
    
    elseif hitItem.Text = "Zoom 125%" then
    // 125% Zoom
    me.mObjectZoom(1.25)
    
    elseif hitItem.Text = "Zoom 100%" then
    // 100% Zoom
    me.mObjectZoom(1.0)
    
    elseif hitItem.text = "Zoom 75%" then
    // 75% Zoom
    me.mObjectZoom(.75)
    
    elseif hitItem.Text = "Zoom 50%" then
    // 50% Zoom
    me.mObjectZoom(.5)
    
    elseif hitItem.Text = "Zoom 25%" then
    // 25% Zoom
    me.mObjectZoom(.25)
    
    elseif hitItem.Text = "Bring to Front" then
    //  Enable Bring to Front
    mNodeBringToFront
    
    elseif hitItem.Text = "Send to Back" then
    //  Enable Bring to Front
    mNodeSendToBack
    end if
  end if
  
  End If
  end if
  
  ContextualOverImage = False
  
else
  
end if
      
_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer 
Onepath Systems, LLC

Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux  
                             Top                DaveS          Post subject: 
Re: Help with Secondary Mouse Click on Track PadPosted: Mon Jun 03, 2013 10:49 
pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA                [cpde]
If IsContextualClick then
  
  if ContextualOverImage Then //Only allow if over a Node Image
  
  if Keyboard.AsyncControlKey or Keyboard.ControlKey then
[/code]

IsContexutalClick is true is the RIGHT mousebutton is clicked (if you have a 
two button mouse) -OR- 
if the Command Key (OSX) / Ctrl Key (WIN) is held down while the LEFT 
mousebutton is clicked

Checking for Keyboard actions is superflous and may be contributiing to you 
problem
That is ASSUMING your OverImage flag is being controlled properly (ie.. is 
true)      
_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                shaosean          Post subject: 
Re: Help with Secondary Mouse Click on Track PadPosted: Mon Jun 03, 2013 11:53 
pm                         
Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293                He was asking how come it does not work with the two 
finger tap multi-gesture on the track pad..      
_________________
Real Studio 2012r1.1 | MacBook Pro i5, 10.6.8 | Windows 7  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to