src/video/cocoa/SDL_cocoawindow.m
changeset 9973 4d8a561cf978
parent 9972 734c90ea9990
child 9983 bbe9ef8c2ecb
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sun Dec 27 23:39:43 2015 -0500
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Dec 28 13:07:44 2015 -0500
     1.3 @@ -589,15 +589,11 @@
     1.4          [NSMenu setMenuBarVisible:NO];
     1.5      }
     1.6  
     1.7 -    /* On pre-10.6, you might have the capslock key state wrong now. */
     1.8 +    /* On pre-10.6, you might have the capslock key state wrong now because we can't check here. */
     1.9      if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_6) {
    1.10 -        const unsigned int oldflags = _data->videodata->modifierFlags & NSAlphaShiftKeyMask;
    1.11          const unsigned int newflags = [NSEvent modifierFlags] & NSAlphaShiftKeyMask;
    1.12 -        if (oldflags != newflags) {
    1.13 -            _data->videodata->modifierFlags = (_data->videodata->modifierFlags & ~NSAlphaShiftKeyMask) | newflags;
    1.14 -            SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK);
    1.15 -            SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK);
    1.16 -        }
    1.17 +        _data->videodata->modifierFlags = (_data->videodata->modifierFlags & ~NSAlphaShiftKeyMask) | newflags;
    1.18 +        SDL_ToggleModState(KMOD_CAPS, newflags != 0);
    1.19      }
    1.20  }
    1.21