Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzEvents.m @ 898:f221cadd6eda
*** empty log message ***
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 17 May 2004 22:42:51 +0000 |
parents | 9e27fdb98eab |
children | af585d6efec8 |
comparison
equal
deleted
inserted
replaced
897:9e27fdb98eab | 898:f221cadd6eda |
---|---|
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 ( NSControlKeyMask & current_mods ) { | 475 if ( NSCommandKeyMask & 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 } | |
534 if ( grab_state == QZ_INVISIBLE_GRAB ) { | 523 if ( grab_state == QZ_INVISIBLE_GRAB ) { |
535 | 524 |
536 /* | 525 /* |
537 If input is grabbed+hidden, the cursor doesn't move, | 526 If input is grabbed+hidden, the cursor doesn't move, |
538 so we have to call the lowlevel window server | 527 so we have to call the lowlevel window server |
651 } while (event != nil); | 640 } while (event != nil); |
652 | 641 |
653 /* handle accumulated mouse moved events */ | 642 /* handle accumulated mouse moved events */ |
654 if (dx != 0 || dy != 0) | 643 if (dx != 0 || dy != 0) |
655 SDL_PrivateMouseMotion (0, 1, dx, dy); | 644 SDL_PrivateMouseMotion (0, 1, dx, dy); |
656 | 645 |
657 [ pool release ]; | 646 [ pool release ]; |
658 } | 647 } |