Changeset 434 for trunk/orca/gl
- Timestamp:
- 07/18/07 00:26:00 (16 months ago)
- Location:
- trunk/orca/gl/glv/mac
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/gl/glv/mac/glv.c
r238 r434 25 25 #define FLAG_FULLSCREEN_MODE 0x0040 26 26 #define FLAG_FILTER_REPEAT 0x0080 27 28 29 static UInt32 mouseButtonModifier[3] = 30 { 31 0, GLV_MASK_LEFT, GLV_MASK_RIGHT, GLV_MASK_MIDDLE 32 }; 27 33 28 34 … … 71 77 ve.type = t; \ 72 78 ve.code = code; \ 73 ve.state = modifiers ; \79 ve.state = modifiers | view->buttonsHeld; \ 74 80 ve.x = 0; \ 75 81 ve.y = 0; … … 147 153 case kEventMouseDown: 148 154 //printf( "KR mouse down\n" ); 155 156 // Let system widgets get first crack at event. 157 result = CallNextEventHandler( myHandler, event ); 158 if( eventNotHandledErr != result ) 159 break; 149 160 150 161 GetEventParameter( event, kEventParamMouseButton, … … 158 169 sizeof(UInt32), NULL, &modifiers ); 159 170 171 if( button < 4 ) 172 view->buttonsHeld |= mouseButtonModifier[ button ]; 173 160 174 ve.type = GLV_EVENT_BUTTON_DOWN; 161 175 ve.code = button; 162 ve.state = modifiers ;176 ve.state = modifiers | view->buttonsHeld; 163 177 ve.x = ((int) location.x) - view->bound.left; 164 178 ve.y = ((int) location.y) - view->bound.top; 165 179 view->eventHandler( view, &ve ); 166 180 167 // result remains eventNotHandledErr so it can propagate.181 result = noErr; 168 182 break; 169 183 … … 181 195 sizeof(UInt32), NULL, &modifiers ); 182 196 197 if( button < 4 ) 198 view->buttonsHeld &= ~mouseButtonModifier[ button ]; 199 183 200 ve.type = GLV_EVENT_BUTTON_UP; 184 201 ve.code = button; 185 ve.state = modifiers ;202 ve.state = modifiers | view->buttonsHeld; 186 203 ve.x = ((int) location.x) - view->bound.left; 187 204 ve.y = ((int) location.y) - view->bound.top; … … 207 224 ve.type = GLV_EVENT_MOTION; 208 225 ve.code = button; 209 ve.state = modifiers ;226 ve.state = modifiers | view->buttonsHeld; 210 227 ve.x = ((int) location.x) - view->bound.left; 211 228 ve.y = ((int) location.y) - view->bound.top; … … 504 521 view->windowEventUUP = NewEventHandlerUPP( windowEventHandler ); 505 522 view->modifiers = 0; 523 view->buttonsHeld = 0; 506 524 507 525 -
trunk/orca/gl/glv/mac/glv.h
r238 r434 49 49 unsigned short flags; 50 50 UInt32 modifiers; 51 UInt32 buttonsHeld; 51 52 int modeId; 52 53 Rect bound;
