diff options
author | Max Horn | 2004-12-30 14:48:21 +0000 |
---|---|---|
committer | Max Horn | 2004-12-30 14:48:21 +0000 |
commit | 989ae4040299c87a2dcb747adb422dbe1458572e (patch) | |
tree | 62b55a10c90045c41587a75f5c147d406aa69974 /backends/sdl | |
parent | f0d0ce7979d89ab67cb702326f900dc721aa01a4 (diff) | |
download | scummvm-rg350-989ae4040299c87a2dcb747adb422dbe1458572e.tar.gz scummvm-rg350-989ae4040299c87a2dcb747adb422dbe1458572e.tar.bz2 scummvm-rg350-989ae4040299c87a2dcb747adb422dbe1458572e.zip |
Swallow ctrl-alt keyup events, too
svn-id: r16384
Diffstat (limited to 'backends/sdl')
-rw-r--r-- | backends/sdl/events.cpp | 59 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 9 |
2 files changed, 11 insertions, 57 deletions
diff --git a/backends/sdl/events.cpp b/backends/sdl/events.cpp index e5cdc89280..c7fe006e5b 100644 --- a/backends/sdl/events.cpp +++ b/backends/sdl/events.cpp @@ -392,69 +392,20 @@ bool OSystem_SDL::pollEvent(Event &event) { event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); #endif - -/* Disabled mouse emulation code (fingolfin, 2004-12-18). - I am keeping the rest of the code in for now, since the joystick - code (or rather, "hack") uses it, too. - switch(ev.key.keysym.sym) { - case SDLK_LEFT: - _km.x_vel = -1; - _km.x_down_count = 1; - break; - case SDLK_RIGHT: - _km.x_vel = 1; - _km.x_down_count = 1; - break; - case SDLK_UP: - _km.y_vel = -1; - _km.y_down_count = 1; - break; - case SDLK_DOWN: - _km.y_vel = 1; - _km.y_down_count = 1; - break; - default: - break; - } -*/ return true; case SDL_KEYUP: event.type = EVENT_KEYUP; event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());; + event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); -/* - switch(ev.key.keysym.sym) { - case SDLK_LEFT: - if (_km.x_vel < 0) { - _km.x_vel = 0; - _km.x_down_count = 0; - } - break; - case SDLK_RIGHT: - if (_km.x_vel > 0) { - _km.x_vel = 0; - _km.x_down_count = 0; - } - break; - case SDLK_UP: - if (_km.y_vel < 0) { - _km.y_vel = 0; - _km.y_down_count = 0; - } - break; - case SDLK_DOWN: - if (_km.y_vel > 0) { - _km.y_vel = 0; - _km.y_down_count = 0; - } - break; - default: + // Ctrl-Alt-<key> will change the GFX mode + if ((b & (KBD_CTRL|KBD_ALT)) == (KBD_CTRL|KBD_ALT)) { + // Swallow these key up events break; } -*/ + return true; case SDL_MOUSEMOTION: diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 276fb4a65f..8f3bd41385 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -204,7 +204,7 @@ protected: kTransactionActive = 2 }; - struct transactionDetails { + struct TransactionDetails { int mode; bool modeChanged; int w; @@ -215,7 +215,8 @@ protected: bool fsChanged; bool ar; bool arChanged; - } _transactionDetails; + }; + TransactionDetails _transactionDetails; /** Force full redraw on next updateScreen */ bool _forceFull; @@ -248,7 +249,9 @@ protected: bool _cksumValid; int _cksumNum; - // Keyboard mouse emulation + // Keyboard mouse emulation. Disabled by fingolfin 2004-12-18. + // I am keeping the rest of the code in for now, since the joystick + // code (or rather, "hack") uses it, too. struct KbdMouse { int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count; uint32 last_time, delay_time, x_down_time, y_down_time; |