diff --git a/control.cpp b/control.cpp index 9475f271..3ba98e25 100644 --- a/control.cpp +++ b/control.cpp @@ -551,9 +551,15 @@ void mainloopiter() { SDL_Event ev; DEBB(DF_GRAPH, (debugfile,"polling for events\n")); - achievement_pump(); + achievement_pump(); + while(SDL_PollEvent(&ev)) handle_event(ev); + fix_mouseh(); + } - while(SDL_PollEvent(&ev)) { +void handle_event(SDL_Event& ev) { + bool normal = cmode & sm::NORMAL; + Uint8 *keystate = SDL_GetKeyState(NULL); + DEBB(DF_GRAPH, (debugfile,"got event type #%d\n", ev.type)); int sym = 0; int uni = 0; @@ -786,9 +792,6 @@ void mainloopiter() { handlekey(sym, uni); } - - fix_mouseh(); - } #endif void mainloop() { diff --git a/hyper.h b/hyper.h index 3dc6380e..637953e9 100644 --- a/hyper.h +++ b/hyper.h @@ -3390,3 +3390,6 @@ void set_priority_board(int id); int get_sync_status(); bool score_loaded(int id); int score_default(int id); +union SDL_Event; +void handle_event(SDL_Event& ev); +