Show
Ignore:
Timestamp:
11/21/07 08:31:17 (10 months ago)
Author:
patrick
Message:

MFT r20939: With Cocoa, identify the right mouse button as MBUTTON3 to be

consistent with X11 and Win32. As for buttons other than the left
and right, use the integer identifier in the NSEvent to determine
which Gadgeteer button value to use. The only special case is
value 2, which we assume will be the middle mouse button
(MBUTTON2).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputAreaCocoa.mm

    r20927 r20940  
    244244         button = gadget::MBUTTON1; 
    245245         break; 
     246      // To be consistent with other windowing systems, we treat button 1 (the 
     247      // right button in AppKit's view) as button 3. 
    246248      case 1: 
     249         button = gadget::MBUTTON3; 
     250         break; 
     251      // We treat button 2 (the first "other" button for AppKit, which tends 
     252      // to be the middle button) as button 2. 
     253      case 2: 
    247254         button = gadget::MBUTTON2; 
    248          break; 
    249       case 2: 
    250          button = gadget::MBUTTON3; 
    251255         break; 
    252256      case 3: 
  • juggler/branches/2.2/modules/gadgeteer/gadget/Devices/KeyboardMouseDevice/InputViewCocoa.mm

    r19856 r20940  
    169169   -(void) mouseDown:(NSEvent*) theEvent 
    170170   { 
    171       mInputArea->addMouseButtonEvent(gadget::MBUTTON1, 
    172                                       gadget::MouseButtonPressEvent, 
     171      mInputArea->addMouseButtonEvent(gadget::MouseButtonPressEvent, 
    173172                                      theEvent); 
    174173   } 
     
    179178   -(void) mouseUp:(NSEvent*) theEvent 
    180179   { 
    181       mInputArea->addMouseButtonEvent(gadget::MBUTTON1, 
    182                                       gadget::MouseButtonReleaseEvent, 
     180      mInputArea->addMouseButtonEvent(gadget::MouseButtonReleaseEvent, 
    183181                                      theEvent); 
    184182   } 
     
    197195   -(void) rightMouseDown:(NSEvent*) theEvent 
    198196   { 
    199       mInputArea->addMouseButtonEvent(gadget::MBUTTON2, 
    200                                       gadget::MouseButtonPressEvent, 
     197      mInputArea->addMouseButtonEvent(gadget::MouseButtonPressEvent, 
    201198                                      theEvent); 
    202199   } 
     
    207204   -(void) rightMouseUp:(NSEvent*) theEvent 
    208205   { 
    209       mInputArea->addMouseButtonEvent(gadget::MBUTTON2, 
    210                                       gadget::MouseButtonReleaseEvent, 
     206      mInputArea->addMouseButtonEvent(gadget::MouseButtonReleaseEvent, 
    211207                                      theEvent); 
    212208   }