From aad356f5f598e4e1f475d065377f931e7a5938e2 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Sun, 29 Jan 2006 23:23:17 +0000 Subject: Knakos patch & Smartphone fixes svn-id: r20305 --- backends/wince/CEActionsSmartphone.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'backends/wince/CEActionsSmartphone.cpp') diff --git a/backends/wince/CEActionsSmartphone.cpp b/backends/wince/CEActionsSmartphone.cpp index b5802915b3..553afea71d 100644 --- a/backends/wince/CEActionsSmartphone.cpp +++ b/backends/wince/CEActionsSmartphone.cpp @@ -33,6 +33,8 @@ #include "common/config-manager.h" +#include "gui/KeysDialog.h" + #ifdef _WIN32_WCE #define KEY_ALL_SKIP 3457 #endif @@ -47,13 +49,14 @@ const String smartphoneActionNames[] = { "Save", "Skip", "Zone", - "FT Cheat" + "FT Cheat", + "Bind Keys" }; #ifdef SIMU_SMARTPHONE -const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8, 0 }; +const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8, 0, VK_RETURN }; #else -const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9', 0 }; +const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9', 0, VK_RETURN }; #endif void CEActionsSmartphone::init(GameDetector &detector) { @@ -150,6 +153,8 @@ void CEActionsSmartphone::initInstanceGame() { // FT Cheat _action_enabled[SMARTPHONE_ACTION_FT_CHEAT] = true; _key_action[SMARTPHONE_ACTION_FT_CHEAT].setAscii(86); // shift-V + // Bind keys + _action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true; } @@ -157,6 +162,8 @@ CEActionsSmartphone::~CEActionsSmartphone() { } bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { + static bool keydialogrunning = false; + if (!pushed) { switch (action) { case SMARTPHONE_ACTION_RIGHTCLICK: @@ -201,6 +208,15 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { case SMARTPHONE_ACTION_ZONE: _CESystem->switch_zone(); return true; + case SMARTPHONE_ACTION_BINDKEYS: + if (!keydialogrunning) { + keydialogrunning = true; + GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); + keysDialog->runModal(); + delete keysDialog; + keydialogrunning = false; + } + return true; } return false; -- cgit v1.2.3