X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;h=d3b00a1efaf125aa38f62561979b5c8a0bdd038c;hb=867fd5d9b79c3b9c1d0fb17ba9f55cfe971b93d5;hp=e06e231d785535488554f9b09975410f8942f667;hpb=2955f56fb11fab871a34db5700befe55737d81d7;p=l2e.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index e06e231..d3b00a1 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -88,6 +88,7 @@ void Application::Loop(void) { void Application::HandleEvents(void) { if (!CurrentState()) return; + input.ResetInteractiveState(); SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { @@ -98,11 +99,16 @@ void Application::HandleEvents(void) { screen->Resize(event.resize.w, event.resize.h); CurrentState()->Resize(event.resize.w, event.resize.h); break; + case SDL_KEYDOWN: + case SDL_KEYUP: + input.HandleKeyboardEvent(event.key); + break; default: - CurrentState()->HandleEvent(event); + // skip event break; } } + CurrentState()->HandleInput(input); } void Application::UpdateWorld(Uint32 deltaT) {