diff options
-rw-r--r-- | gui/ListWidget.cpp | 1 | ||||
-rw-r--r-- | newgui.cpp | 4 | ||||
-rw-r--r-- | scummvm.cpp | 1 | ||||
-rw-r--r-- | sdl.cpp | 21 | ||||
-rw-r--r-- | sdl_gl.cpp | 7 | ||||
-rw-r--r-- | system.h | 2 |
6 files changed, 23 insertions, 13 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index e58e677e85..68d4817d04 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -27,7 +27,6 @@ /* * TODO: - * - Fix the random key repeating bug * - Allow escape to abort changes * - Add key repeat (for backspace, etc) */ diff --git a/newgui.cpp b/newgui.cpp index f5826884b9..8263e23b1f 100644 --- a/newgui.cpp +++ b/newgui.cpp @@ -116,8 +116,8 @@ void NewGui::loop() case OSystem::EVENT_KEYDOWN: activeDialog->handleKeyDown(t.kbd.ascii, t.kbd.flags); break; -// case OSystem::EVENT_KEYUP: -// activeDialog->handleKeyUp(t.kbd.ascii, t.kbd.flags); + case OSystem::EVENT_KEYUP: + activeDialog->handleKeyUp(t.kbd.ascii, t.kbd.flags); break; case OSystem::EVENT_MOUSEMOVE: activeDialog->handleMouseMoved(t.mouse.x - activeDialog->_x, t.mouse.y - activeDialog->_y, 0); diff --git a/scummvm.cpp b/scummvm.cpp index fe0eed7281..d9b9a8cae9 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -1262,7 +1262,6 @@ void Scumm::waitForTimer(int msec_delay) { for(;;) { while (_system->poll_event(&event)) { - // if newgui is running, copy event to EventList, and let the GUI handle it itself // we might consider this approach for ScummLoop as well, and clean up the current mess if (_newgui->isActive()) @@ -835,27 +835,27 @@ bool OSystem_SDL::poll_event(Event *event) { if (ev.key.keysym.mod & KMOD_CTRL) b |= KBD_CTRL; if (ev.key.keysym.mod & KMOD_ALT) b |= KBD_ALT; event->kbd.flags = b; - + /* internal keypress? */ if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { property(PROP_TOGGLE_FULLSCREEN, NULL); break; } - + if ((b == KBD_CTRL && ev.key.keysym.sym=='z') || (b == KBD_ALT && ev.key.keysym.sym=='x')) { quit(); break; } - + if (b == (KBD_CTRL|KBD_ALT) && - (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { + (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { Property prop; prop.gfx_mode = ev.key.keysym.sym - '1'; property(PROP_SET_GFX_MODE, &prop); break; } - - + + event->event_code = EVENT_KEYDOWN; event->kbd.keycode = ev.key.keysym.sym; event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); @@ -879,11 +879,15 @@ bool OSystem_SDL::poll_event(Event *event) { default: break; } - + return true; } - case SDL_KEYUP: { + case SDL_KEYUP: { + event->event_code = EVENT_KEYUP; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + switch(ev.key.keysym.sym){ case SDLK_LEFT: if (km.x_vel < 0) { @@ -956,6 +960,7 @@ bool OSystem_SDL::poll_event(Event *event) { quit(); } } + } bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { diff --git a/sdl_gl.cpp b/sdl_gl.cpp index 15bf19f6f0..f44c01d4e0 100644 --- a/sdl_gl.cpp +++ b/sdl_gl.cpp @@ -591,6 +591,13 @@ bool OSystem_SDL::poll_event(Event *event) { return true; } + case SDL_KEYUP: + event->event_code = EVENT_KEYUP; + event->kbd.keycode = ev.key.keysym.sym; + event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod); + + return true; + case SDL_MOUSEMOTION: event->event_code = EVENT_MOUSEMOVE; event->mouse.x = ev.motion.x; @@ -44,7 +44,7 @@ public: enum { EVENT_KEYDOWN = 1, -// EVENT_KEYUP = 2, + EVENT_KEYUP = 2, EVENT_MOUSEMOVE = 3, EVENT_LBUTTONDOWN = 4, EVENT_LBUTTONUP = 5, |