Improve SDL keyboard event handling

replace/457f14a8dc5f4bb821fc0da0cc7064e95a630e54
Fred 2020-11-11 11:01:27 +01:00
rodzic b4b3b3fa5a
commit f10a6e426c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -30,7 +30,7 @@ uint32_t kbd_getKeys() {
if (event.type == SDL_QUIT)
exit(0);
//Ignore all non-keyboard events
if (event.type != SDL_KEYDOWN) return 0;
if (event.type != SDL_KEYDOWN) continue;
const uint8_t *state = SDL_GetKeyboardState(NULL);
if (state[SDL_SCANCODE_0]) keys |= KEY_0;
if (state[SDL_SCANCODE_1]) keys |= KEY_1;