Fixed Keyboard input for WebGL

This commit is contained in:
n00b
2024-11-11 13:37:23 -05:00
parent bffa478064
commit b66e458590
5 changed files with 21 additions and 10 deletions

View File

@@ -218,6 +218,7 @@ bool rc_gfx_init()
}
}
SDL_SetHint("SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS", "1");
SDL_SetHint("SDL_HINT_EMSCRIPTEN_ASYNCIFY", "1");
return true;
@@ -1836,6 +1837,7 @@ int rc_inKey()
int rc_key(int check_Key)
{
keyState = SDL_GetKeyboardState(NULL);
return keyState[SDL_GetScancodeFromKey(check_Key)];
}
@@ -3372,7 +3374,7 @@ bool rc_update()
irrevent.UserEvent.UserData1 = reinterpret_cast<uintptr_t>(SDL_event.user.data1);
irrevent.UserEvent.UserData2 = reinterpret_cast<uintptr_t>(SDL_event.user.data2);
device->postEventFromUser(irrevent);
//device->postEventFromUser(irrevent);
break;
default:
@@ -3381,6 +3383,7 @@ bool rc_update()
} // end while
if(!Close)
{
irrtheora::updateVideo();