Real Software Forums
http://forums.realsoftware.com/

Help with Secondary Mouse Click on Track Pad
http://forums.realsoftware.com/viewtopic.php?f=7&t=48057
Page 1 of 1

Author:  mikecotrone [ Mon Jun 03, 2013 7:02 pm ]
Post subject:  Help with Secondary Mouse Click on Track Pad

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

Author:  DaveS [ Mon Jun 03, 2013 10:49 pm ]
Post subject:  Re: Help with Secondary Mouse Click on Track Pad

[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)

Author:  shaosean [ Mon Jun 03, 2013 11:53 pm ]
Post subject:  Re: Help with Secondary Mouse Click on Track Pad

He was asking how come it does not work with the two finger tap multi-gesture on the track pad..

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/