Fix modifiers getting stuck after attaching debugger, at least for windows..
This commit is contained in:
@@ -347,11 +347,18 @@ struct { String string; SDL_Keycode value; } SDLKeycodeConversionTable[] = {
|
||||
};
|
||||
|
||||
void FillEventWithBasicData(Event *event) {
|
||||
if (OS_WINDOWS) {
|
||||
if (GetKeyState(VK_SHIFT) & 0x8000) event->shift = 1;
|
||||
if (GetKeyState(VK_CONTROL) & 0x8000) event->ctrl = 1;
|
||||
if (GetKeyState(VK_MENU) & 0x8000) event->alt = 1;
|
||||
if (GetKeyState(VK_LWIN) & 0x8000) event->super = 1;
|
||||
} else {
|
||||
SDL_Keymod mod = SDL_GetModState();
|
||||
event->shift = (mod & SDL_KMOD_SHIFT) != 0;
|
||||
event->ctrl = (mod & SDL_KMOD_CTRL) != 0;
|
||||
event->alt = (mod & SDL_KMOD_ALT) != 0;
|
||||
event->super = (mod & SDL_KMOD_GUI) != 0;
|
||||
}
|
||||
|
||||
float xmouse, ymouse;
|
||||
SDL_GetMouseState(&xmouse, &ymouse);
|
||||
@@ -371,6 +378,7 @@ Event TranslateSDLEvent(SDL_Event *input_event) {
|
||||
FillEventWithBasicData(&event);
|
||||
|
||||
switch (input_event->type) {
|
||||
|
||||
case SDL_EVENT_QUIT: {
|
||||
event.kind = EVENT_QUIT;
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user