From 76298a9cec9d8c3eba02afee32b22c2a67861a2b Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Sat, 17 Jan 2004 23:40:36 +0000 Subject: Implements TOGGLE_VIRTUAL_KEYBOARD svn-id: r12459 --- common/debugger.cpp | 16 ++++++---------- scumm/dialogs.cpp | 14 +++++++------- simon/items.cpp | 45 +++++++++++++++------------------------------ sky/control.cpp | 21 +++++++++------------ 4 files changed, 37 insertions(+), 59 deletions(-) diff --git a/common/debugger.cpp b/common/debugger.cpp index 254296103b..03fd28688d 100644 --- a/common/debugger.cpp +++ b/common/debugger.cpp @@ -26,10 +26,6 @@ #include "gui/console.h" #endif -#ifdef _WIN32_WCE -extern void force_keyboard(bool); -#endif - namespace Common { template @@ -71,9 +67,9 @@ int Debugger::DebugPrintf(const char *format, ...) { template void Debugger::attach(const char *entry) { -#ifdef _WIN32_WCE - force_keyboard(true); -#endif + OSystem::Property prop; + prop.show_keyboard = true; + g_system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); if (entry) { _errStr = strdup(entry); @@ -86,9 +82,9 @@ void Debugger::attach(const char *entry) { template void Debugger::detach() { -#ifdef _WIN32_WCE - force_keyboard(false); -#endif + OSystem::Property prop; + prop.show_keyboard = false; + g_system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); _detach_now = false; _isAttached = false; diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index bfbc5ef578..b06f14cdb3 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -42,7 +42,6 @@ #ifdef _WIN32_WCE #include "gapi_keys.h" extern bool _get_key_mapping; -extern void force_keyboard(bool); extern void save_key_mapping(); extern void load_key_mapping(); #endif @@ -325,9 +324,9 @@ MainMenuDialog::~MainMenuDialog() { } void MainMenuDialog::open() { -#ifdef _WIN32_WCE - force_keyboard(true); -#endif + OSystem::Property prop; + prop.show_keyboard = true; + g_system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); ScummDialog::open(); } @@ -364,11 +363,12 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat } void MainMenuDialog::close() { + OSystem::Property prop; + ScummDialog::close(); -#ifdef _WIN32_WCE - force_keyboard(false); -#endif + prop.show_keyboard = false; + g_system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); } void MainMenuDialog::save() { diff --git a/simon/items.cpp b/simon/items.cpp index 1916b84e22..e3ed750e24 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -26,12 +26,6 @@ #include "simon/simon.h" #include "simon/intern.h" -#ifdef _WIN32_WCE - -extern void force_keyboard(bool); - -#endif - namespace Simon { int SimonEngine::runScript() { @@ -737,28 +731,22 @@ int SimonEngine::runScript() { break; case 132:{ /* save game */ -#ifdef _WIN32_WCE - force_keyboard(true); -#endif - + OSystem::Property prop; + prop.show_keyboard = true; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); o_save_game(); - -#ifdef _WIN32_WCE - force_keyboard(false); -#endif + prop.show_keyboard = false; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); } break; case 133:{ /* load game */ -#ifdef _WIN32_WCE - force_keyboard(true); -#endif - + OSystem::Property prop; + prop.show_keyboard = true; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); o_load_game(); - -#ifdef _WIN32_WCE - force_keyboard(false); -#endif + prop.show_keyboard = false; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); } break; @@ -769,15 +757,12 @@ int SimonEngine::runScript() { break; case 135:{ /* quit if user presses y */ -#ifdef _WIN32_WCE - force_keyboard(true); -#endif - + OSystem::Property prop; + prop.show_keyboard = true; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); o_quit_if_user_presses_y(); - -#ifdef _WIN32_WCE - force_keyboard(false); -#endif + prop.show_keyboard = false; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); } break; diff --git a/sky/control.cpp b/sky/control.cpp index c5a3635248..942c19a649 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -35,10 +35,6 @@ #include "sky/struc.h" #include "sky/text.h" -#ifdef _WIN32_WCE -extern void force_keyboard(bool); -#endif - namespace Sky { @@ -807,11 +803,11 @@ uint16 Control::saveRestorePanel(bool allowSave) { uint16 cnt; uint8 lookListLen; if (allowSave) { + OSystem::Property prop; lookList = _savePanLookList; lookListLen = 6; -#ifdef _WIN32_WCE - force_keyboard(true); -#endif + prop.show_keyboard = true; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); } else { lookList = _restorePanLookList; if (autoSaveExists()) @@ -918,11 +914,12 @@ uint16 Control::saveRestorePanel(bool allowSave) { free(saveGameTexts); -#ifdef _WIN32_WCE - if (allowSave) - force_keyboard(false); -#endif - + if (allowSave) { + OSystem::Property prop; + prop.show_keyboard = false; + _system->property(OSystem::PROP_TOGGLE_VIRTUAL_KEYBOARD, &prop); + } + return clickRes; } -- cgit v1.2.3