changeset 5392:66d7aabf5b41

hgk: fix right-mouse button handling under macosx
author Patrick Mezard <pmezard@gmail.com>
date Tue, 02 Oct 2007 23:28:02 +0200
parents 786c1206a029
children c2ad1890fc53
files contrib/hgk
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk
+++ b/contrib/hgk
@@ -73,6 +73,15 @@ bind all <MouseWheel> [list ::tk::MouseW
 }
 
 
+# Unify right mouse button handling.
+# See "mouse buttons on macintosh" thread on comp.lang.tcl
+if {[tk windowingsystem] eq "aqua"} {
+    event add <<B3>> <Control-ButtonPress-1>
+    event add <<B3>> <Button-2>
+} else {
+    event add <<B3>> <Button-3>
+}
+
 proc gitdir {} {
     global env
     if {[info exists env(GIT_DIR)]} {
@@ -937,7 +946,7 @@ proc drawcommitline {level} {
     set date [lindex $commitinfo($id) 2]
     set linehtag($lineno) [$canv create text $xt $y1 -anchor w \
 			       -text $headline -font $mainfont ]
-    $canv bind $linehtag($lineno) <Button-3> "rowmenu %X %Y $id"
+    $canv bind $linehtag($lineno) <<B3>> "rowmenu %X %Y $id"
     set linentag($lineno) [$canv2 create text 3 $y1 -anchor w \
 			       -text $name -font $namefont]
     set linedtag($lineno) [$canv3 create text 3 $y1 -anchor w \