diff options
author | Nicolas Bacca | 2002-12-02 00:05:05 +0000 |
---|---|---|
committer | Nicolas Bacca | 2002-12-02 00:05:05 +0000 |
commit | 718b935d485f6ea87d90ad13d3e9b9329e1ffd78 (patch) | |
tree | 2ea2d8765d55d91694a259a1de1db6ee93a08bdc /simon | |
parent | 04f5220874f3a1e76450d5344674418f342a07ff (diff) | |
download | scummvm-rg350-718b935d485f6ea87d90ad13d3e9b9329e1ffd78.tar.gz scummvm-rg350-718b935d485f6ea87d90ad13d3e9b9329e1ffd78.tar.bz2 scummvm-rg350-718b935d485f6ea87d90ad13d3e9b9329e1ffd78.zip |
Fix WinCE keyboard + change quit key for foreign languages (fixme ?)
svn-id: r5806
Diffstat (limited to 'simon')
-rw-r--r-- | simon/items.cpp | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/simon/items.cpp b/simon/items.cpp index 68cb5e9cb9..8db0e97ca4 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -20,14 +20,15 @@ */ // Item script opcodes for Simon1/Simon2 +#include <ctype.h> + #include "stdafx.h" #include "simon/simon.h" #include "simon/intern.h" #ifdef _WIN32_WCE -extern bool toolbar_drawn; -extern bool draw_keyboard; +extern void force_keyboard(bool); #endif @@ -752,18 +753,27 @@ int SimonState::runScript() case 132:{ /* save game */ #ifdef _WIN32_WCE - - if (!draw_keyboard) { - draw_keyboard = true; - toolbar_drawn = false; - } + force_keyboard(true); #endif + o_save_game(); + +#ifdef _WIN32_WCE + force_keyboard(false); +#endif } break; case 133:{ /* load game */ +#ifdef _WIN32_WCE + force_keyboard(true); +#endif + o_load_game(); + +#ifdef _WIN32_WCE + force_keyboard(false); +#endif } break; @@ -774,7 +784,15 @@ int SimonState::runScript() break; case 135:{ /* quit if user presses y */ +#ifdef _WIN32_WCE + force_keyboard(true); +#endif + o_quit_if_user_presses_y(); + +#ifdef _WIN32_WCE + force_keyboard(false); +#endif } break; @@ -1482,11 +1500,16 @@ void SimonState::o_quit_if_user_presses_y() for (;;) { _system->poll_event(&event); - if (event.event_code == OSystem::EVENT_KEYDOWN) - if (event.kbd.keycode == 'y') + if (event.event_code == OSystem::EVENT_KEYDOWN) { + event.kbd.keycode = toupper(event.kbd.keycode); + // FIXME Arisme : better than being blocked ? + if (event.kbd.keycode == 'Y' || + event.kbd.keycode == 'O' || /* french */ + event.kbd.keycode == 'J' /* german I guess :) */) _system->quit(); - else if (event.kbd.keycode == 'n') + else if (event.kbd.keycode == 'N') break; + } delay(10); } } |