problem with left+right mouse down+up on Mac

I'm having an issue with right and left mouse button events on OSX.   
I use a two button mouse, and when both buttons are down at the same  
time, the subsequent button up events get mangled.  I looked at the  
code in src/mac/carbon/toplevel.cpp, specifically the SetupMouseEvent  
method, and see that there's a snippet in there that is trying to  
adjust for control-clicks that are interpreted as right-clicks.  this  
appears to be by design but is causing me problems...  I would even  
call it a bug perhaps

void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
    // a control click is interpreted as a right click
     if ( button == kEventMouseButtonPrimary && (modifiers &  
controlKey) )
         button = kEventMouseButtonSecondary ;

     // otherwise we report double clicks by connecting a left click  
with a ctrl-left click
     if ( clickCount > 1 && button != g_lastButton )
         clickCount = 1 ;

     // we must make sure that our synthetic 'right' button  
corresponds in
     // mouse down, moved and mouse up, and does not deliver a right  
down and left up

     if ( cEvent.GetKind() == kEventMouseDown )
         g_lastButton = button ;

     if ( button == 0 )
         g_lastButton = 0 ;
     else if ( g_lastButton )
         button = g_lastButton ;
could this be modified to only kluge the buttons if it really was a  
ctrl-left click, rather than always forcing a button up event to  
assume the button of the most recent button down event?  or would  
that break a dozen other things?

To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

2/14/2007 4:48:22 AM
comp.soft-sys.wxwindows 21076 articles. 0 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 1