[GRASS-dev] Re: [GRASS GIS] #1187: TclTk digitizer does not recognize right-click

GRASS GIS trac at osgeo.org
Wed Dec 1 20:30:37 EST 2010


#1187: TclTk digitizer does not recognize right-click
---------------------------------------------+------------------------------
 Reporter:  cmbarton                         |       Owner:  grass-dev@…              
     Type:  defect                           |      Status:  new                      
 Priority:  critical                         |   Milestone:  6.4.1                    
Component:  Tcl/Tk                           |     Version:  6.4.0                    
 Keywords:  digitizer, v.digit, right-click  |    Platform:  MacOSX                   
      Cpu:  OSX/Intel                        |  
---------------------------------------------+------------------------------

Comment(by cmbarton):

 The following code fixes this bug report:


 {{{
     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
 }
         }
 }}}

 I can go ahead and commit it.

 Michael

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1187#comment:14>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list