diff --git a/src/video/quartz/SDL_QuartzEvents.m b/src/video/quartz/SDL_QuartzEvents.m index 8c13a8d88..617ae9d9f 100644 --- a/src/video/quartz/SDL_QuartzEvents.m +++ b/src/video/quartz/SDL_QuartzEvents.m @@ -266,6 +266,9 @@ static void QZ_DoModifiers (_THIS, unsigned int newMods) { int i; int bit; SDL_keysym key; + + if (current_mods == newMods) + return; key.scancode = 0; key.sym = SDLK_UNKNOWN; @@ -462,6 +465,8 @@ void QZ_PumpEvents (_THIS) type = [ event type ]; isInGameWin = QZ_IsMouseInWindow (this); + QZ_DoModifiers(this, [ event modifierFlags ] ); + switch (type) { case NSLeftMouseDown: if ( getenv("SDL_HAS3BUTTONMOUSE") ) { @@ -613,7 +618,6 @@ void QZ_PumpEvents (_THIS) QZ_DoKey (this, SDL_PRESSED, event); break; case NSFlagsChanged: - QZ_DoModifiers(this, [ event modifierFlags ] ); break; case NSAppKitDefined: switch ( [ event subtype ] ) { diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index 57cd8fc84..c4225a319 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -203,6 +203,7 @@ static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format) { current_grab_mode = SDL_GRAB_OFF; cursor_should_be_visible = YES; cursor_visible = YES; + current_mods = -1; /* register for sleep notifications so wake from sleep generates SDL_VIDEOEXPOSE */ QZ_RegisterForSleepNotifications (this);