From eca7e8600f43952219b75377278f3f5e789856d8 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 1 Jun 2009 10:25:51 +0000 Subject: [PATCH] Some mapper fixes related to interfacing with mapper overlay. Fixes missing keyups etc Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3414 --- src/gui/sdl_mapper.cpp | 7 +++++-- src/gui/sdlmain.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/sdl_mapper.cpp b/src/gui/sdl_mapper.cpp index d8f3c4cb..480f0e4b 100644 --- a/src/gui/sdl_mapper.cpp +++ b/src/gui/sdl_mapper.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdl_mapper.cpp,v 1.59 2009-05-14 18:01:25 qbix79 Exp $ */ +/* $Id: sdl_mapper.cpp,v 1.60 2009-06-01 10:25:51 qbix79 Exp $ */ #include #include @@ -2126,7 +2126,7 @@ void BIND_MappingEvents(void) { SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { - case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: /* Check the press */ for (CButton_it but_it = buttons.begin();but_it!=buttons.end();but_it++) { if ((*but_it)->OnTop(event.button.x,event.button.y)) { @@ -2272,7 +2272,10 @@ void MAPPER_Run(bool pressed) { return; KEYBOARD_ClrBuffer(); //Clear buffer GFX_LosingFocus(); //Release any keys pressed (buffer gets filled again). + MAPPER_RunInternal(); +} +void MAPPER_RunInternal() { int cursor = SDL_ShowCursor(SDL_QUERY); SDL_ShowCursor(SDL_ENABLE); bool mousetoggle=false; diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 4ce3d12a..555a411d 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdlmain.cpp,v 1.153 2009-05-25 16:29:36 qbix79 Exp $ */ +/* $Id: sdlmain.cpp,v 1.154 2009-06-01 10:25:51 qbix79 Exp $ */ #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -1816,7 +1816,7 @@ int main(int argc, char* argv[]) { /* Init the keyMapper */ MAPPER_Init(); - if (control->cmdline->FindExist("-startmapper")) MAPPER_Run(false); + if (control->cmdline->FindExist("-startmapper")) MAPPER_RunInternal(); /* Start up main machine */ control->StartUp(); /* Shutdown everything */