mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-03 17:35:30 +00:00
cocoa: Resync modifier keypressed on NSEventTypeFlagsChanged event.
Fixes #7507. (cherry picked from commit 70b65d4170bbff6a8c2ffc9b5834ec85384f6fc0)
This commit is contained in:
parent
0134672345
commit
61cd57d378
|
@ -437,9 +437,19 @@ void Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
|
|||
case NSEventTypeKeyUp:
|
||||
SDL_SendKeyboardKey(SDL_RELEASED, code);
|
||||
break;
|
||||
case NSEventTypeFlagsChanged:
|
||||
HandleModifiers(_this, code, (unsigned int)[event modifierFlags]);
|
||||
case NSEventTypeFlagsChanged: {
|
||||
// see if the new modifierFlags mean any existing keys should be pressed/released...
|
||||
const unsigned int modflags = (unsigned int)[event modifierFlags];
|
||||
HandleModifiers(_this, SDL_SCANCODE_LSHIFT, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_LCTRL, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_LALT, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_LGUI, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_RSHIFT, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_RCTRL, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_RALT, modflags);
|
||||
HandleModifiers(_this, SDL_SCANCODE_RGUI, modflags);
|
||||
break;
|
||||
}
|
||||
default: /* just to avoid compiler warnings */
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue