src/video/quartz/SDL_QuartzEvents.m
changeset 897 9e27fdb98eab
parent 816 428f688f2ad2
child 898 f221cadd6eda
equal deleted inserted replaced
896:b56dc586a5ef 897:9e27fdb98eab
   470             switch (type) {
   470             switch (type) {
   471                 case NSLeftMouseDown:
   471                 case NSLeftMouseDown:
   472                     if ( getenv("SDL_HAS3BUTTONMOUSE") ) {
   472                     if ( getenv("SDL_HAS3BUTTONMOUSE") ) {
   473                         DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
   473                         DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
   474                     } else {
   474                     } else {
   475                         if ( NSCommandKeyMask & current_mods ) {
   475                         if ( NSControlKeyMask & current_mods ) {
   476                             last_virtual_button = SDL_BUTTON_RIGHT;
   476                             last_virtual_button = SDL_BUTTON_RIGHT;
   477                             DO_MOUSE_DOWN (SDL_BUTTON_RIGHT);
   477                             DO_MOUSE_DOWN (SDL_BUTTON_RIGHT);
   478                         }
   478                         }
   479                         else if ( NSAlternateKeyMask & current_mods ) {
   479                         else if ( NSAlternateKeyMask & current_mods ) {
   480                             last_virtual_button = SDL_BUTTON_MIDDLE;
   480                             last_virtual_button = SDL_BUTTON_MIDDLE;
   517                     */
   517                     */
   518                     break;
   518                     break;
   519                 case NSLeftMouseDragged:
   519                 case NSLeftMouseDragged:
   520                 case NSRightMouseDragged:
   520                 case NSRightMouseDragged:
   521                 case NSOtherMouseDragged: /* usually middle mouse dragged */
   521                 case NSOtherMouseDragged: /* usually middle mouse dragged */
   522                 case NSMouseMoved:
   522                 case NSMouseMoved:    
       
   523                     /* Show the cursor if it was hidden by SDL_ShowCursor() */
       
   524                     /* this is how games I've seen work */
       
   525                     if (!cursor_visible) {
       
   526                         if (!isInGameWin && cursor_hidden) {
       
   527                             ShowCursor();
       
   528                             cursor_hidden = NO;
       
   529                         } else if (isInGameWin && !cursor_hidden) {
       
   530                             HideCursor();
       
   531                             cursor_hidden = YES;
       
   532                         }
       
   533                     }
   523                     if ( grab_state == QZ_INVISIBLE_GRAB ) {
   534                     if ( grab_state == QZ_INVISIBLE_GRAB ) {
   524                 
   535                 
   525                         /*
   536                         /*
   526                             If input is grabbed+hidden, the cursor doesn't move,
   537                             If input is grabbed+hidden, the cursor doesn't move,
   527                             so we have to call the lowlevel window server
   538                             so we have to call the lowlevel window server
   640     } while (event != nil);
   651     } while (event != nil);
   641     
   652     
   642     /* handle accumulated mouse moved events */
   653     /* handle accumulated mouse moved events */
   643     if (dx != 0 || dy != 0)
   654     if (dx != 0 || dy != 0)
   644         SDL_PrivateMouseMotion (0, 1, dx, dy);
   655         SDL_PrivateMouseMotion (0, 1, dx, dy);
   645     
   656 
   646     [ pool release ];
   657     [ pool release ];
   647 }
   658 }