[GRASS-SVN] r44505 - grass/branches/releasebranch_6_4/vector/v.digit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 1 20:47:43 EST 2010


Author: cmbarton
Date: 2010-12-01 17:47:43 -0800 (Wed, 01 Dec 2010)
New Revision: 44505

Modified:
   grass/branches/releasebranch_6_4/vector/v.digit/toolbox.tcl
Log:
Backport from r44504 develbranch_6. Fix bug #1187 - reversed mouse buttons 2 and 3, and no access to buttons 2 & 3 from trackpad for Mac.

Modified: grass/branches/releasebranch_6_4/vector/v.digit/toolbox.tcl
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.digit/toolbox.tcl	2010-12-02 01:42:43 UTC (rev 44504)
+++ grass/branches/releasebranch_6_4/vector/v.digit/toolbox.tcl	2010-12-02 01:47:43 UTC (rev 44505)
@@ -42,7 +42,29 @@
     toplevel .screen
     canvas .screen.canvas -background white -width 640 -height 480
     pack .screen.canvas -fill both -expand yes
-    bind .screen.canvas <ButtonPress> { c_update_tool %x %y %b }
+    
+    if {[tk windowingsystem] eq "aqua"} {
+		
+#		# option + left-click for Mac equals middle-click
+		bind .screen.canvas <Option-Button-1> { c_update_tool %x %y 2 }
+#		# control + left-click for Mac equals right-click
+		bind .screen.canvas <Control-Button-1> { c_update_tool %x %y 3 }
+
+		# right-click is acting like a middle-click...
+		bind .screen.canvas <ButtonPress> {
+            puts "button: %b"
+			if { %b == 3 } {
+				c_update_tool %x %y 2
+			} elseif { %b == 2 } {
+				c_update_tool %x %y 3
+			} else {
+				c_update_tool %x %y %b
+			}
+		}
+	} else {
+		bind .screen.canvas <ButtonPress> { c_update_tool %x %y %b }
+	}
+    
     bind .screen.canvas <Motion> { c_update_tool %x %y -1 }
     wm title .screen "v.digit - $map_name@$map_mapset"
     wm withdraw .screen



More information about the grass-commit mailing list