[Scummvm-cvs-logs] SF.net SVN: scummvm: [26133] scummvm/trunk/backends/platform/symbian/src
anotherguest at users.sourceforge.net
anotherguest at users.sourceforge.net
Wed Mar 14 20:25:33 CET 2007
Revision: 26133
http://scummvm.svn.sourceforge.net/scummvm/?rev=26133&view=rev
Author: anotherguest
Date: 2007-03-14 12:25:33 -0700 (Wed, 14 Mar 2007)
Log Message:
-----------
Add new KeyMappings (Debugger & Fast mode) for Symbian OS.
Modified Paths:
--------------
scummvm/trunk/backends/platform/symbian/src/SymbianActions.cpp
scummvm/trunk/backends/platform/symbian/src/SymbianActions.h
scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
scummvm/trunk/backends/platform/symbian/src/SymbianOS.h
Modified: scummvm/trunk/backends/platform/symbian/src/SymbianActions.cpp
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianActions.cpp 2007-03-14 12:35:57 UTC (rev 26132)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianActions.cpp 2007-03-14 19:25:33 UTC (rev 26133)
@@ -48,17 +48,19 @@
"Swap character",
"Skip text",
"Pause",
- "Quit"
+ "Fast mode",
+ "Quit",
+ "Debugger"
};
#ifdef UIQ
-static const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, SDLK_F1, SDLK_F2, SDLK_F5, SDLK_PAGEDOWN, 0, 0, 0, SDLK_PAGEUP, 0, 0};
+static const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, SDLK_F1, SDLK_F2, SDLK_F5, SDLK_PAGEDOWN, 0, 0, 0, SDLK_PAGEUP, 0, 0, 0, 0};
#elif defined (S60)
-const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0, 0, '*', '#', '9',0,0,0,0,0};
+const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0, 0, '*', '#', '9', 0, 0, 0, 0, 0, 0, 0};
#elif defined (S90)
-const int ACTIONS_DEFAULT[ACTION_LAST] = { SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, 0, 0, SDLK_MENU, SDLK_ESCAPE, 0, 0,0,0,0,0};
+const int ACTIONS_DEFAULT[ACTION_LAST] = { SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, 0, 0, SDLK_MENU, SDLK_ESCAPE, 0, 0 , 0, 0, 0, 0, 0, 0};
#else
-const int ACTIONS_DEFAULT[ACTION_LAST] = { SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, SDLK_F1, SDLK_F2, SDLK_MENU, SDLK_ESCAPE, 0, 0, 0, 0, 0, 0};
+const int ACTIONS_DEFAULT[ACTION_LAST] = { SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, SDLK_F1, SDLK_F2, SDLK_MENU, SDLK_ESCAPE, 0, 0, 0, 0, 0, 0, 0, 0};
#endif
// creator function according to Factory Pattern
@@ -138,9 +140,9 @@
// Initialize keys for different actions
// Save
- if (is_simon || is_sword2 || is_gob || is_kyra || is_touche)
+ if (is_simon || is_gob || is_kyra || is_touche)
_action_enabled[ACTION_SAVE] = false;
- else if (is_queen || is_saga) {
+ else if (is_queen) {
_action_enabled[ACTION_SAVE] = true;
_key_action[ACTION_SAVE].setAscii(SDLK_F1); // F1 key for FOTAQ
} else if (is_sky) {
@@ -157,6 +159,11 @@
_key_action[ACTION_SAVE].setAscii(SDLK_F5); // F5 key
}
+ // Enable fast mode
+ _action_enabled[ACTION_FASTMODE] = true;
+ _key_action[ACTION_FASTMODE].setAscii('f');
+ _key_action[ACTION_FASTMODE].setFlags(KMOD_CTRL);
+
// Swap character
_action_enabled[ACTION_SWAPCHAR] = true;
_key_action[ACTION_SWAPCHAR].setAscii('b'); // b
@@ -168,6 +175,11 @@
_action_enabled[ACTION_FT_CHEAT] = true;
_key_action[ACTION_FT_CHEAT].setAscii(86); // shift-V
+ // Enable debugger
+ _action_enabled[ACTION_DEBUGGER] = true;
+ _key_action[ACTION_DEBUGGER].setAscii('d');
+ _key_action[ACTION_DEBUGGER].setFlags(KMOD_CTRL);
+
// Skip text
if (!is_cine)
_action_enabled[ACTION_SKIP_TEXT] = true;
Modified: scummvm/trunk/backends/platform/symbian/src/SymbianActions.h
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianActions.h 2007-03-14 12:35:57 UTC (rev 26132)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianActions.h 2007-03-14 19:25:33 UTC (rev 26133)
@@ -47,7 +47,9 @@
ACTION_SWAPCHAR,
ACTION_SKIP_TEXT,
ACTION_PAUSE,
+ ACTION_FASTMODE,
ACTION_QUIT,
+ ACTION_DEBUGGER,
ACTION_LAST
};
Modified: scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp 2007-03-14 12:35:57 UTC (rev 26132)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp 2007-03-14 19:25:33 UTC (rev 26133)
@@ -79,6 +79,21 @@
}
}
+void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) {
+ switch(f) {
+ case kFeatureVirtualKeyboard:
+ if (enable) {
+ }
+ else {
+
+ }
+
+ return;
+ default:
+ OSystem_SDL::setFeatureState(f, enable);
+ }
+}
+
OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = {
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
@@ -335,12 +350,31 @@
case GUI::ACTION_FT_CHEAT:
case GUI::ACTION_SKIP_TEXT:
case GUI::ACTION_PAUSE:
+ case GUI::ACTION_SWAPCHAR:
+ case GUI::ACTION_FASTMODE:
+ case GUI::ACTION_DEBUGGER:
{
GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
- ev.key.keysym.sym = (SDLKey)key.ascii();
+ ev.key.keysym.sym = (SDLKey) key.ascii();
ev.key.keysym.scancode= key.keycode();
- ev.key.keysym.mod = (SDLMod)key.flags();
+ ev.key.keysym.mod = (SDLMod) key.flags();
+ // Translate from SDL keymod event to Scummvm Key Mod Event.
+ // This codes is also present in GP32 backend and in SDL backend as a static function
+ // Perhaps it should be shared.
+ if(key.flags() != 0) {
+ event.kbd.flags = 0;
+
+ if (ev.key.keysym.mod & KMOD_SHIFT)
+ event.kbd.flags |= OSystem::KBD_SHIFT;
+
+ if (ev.key.keysym.mod & KMOD_ALT)
+ event.kbd.flags |= OSystem::KBD_ALT;
+
+ if (ev.key.keysym.mod & KMOD_CTRL)
+ event.kbd.flags |= OSystem::KBD_CTRL;
+ }
+
return false;
}
Modified: scummvm/trunk/backends/platform/symbian/src/SymbianOS.h
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianOS.h 2007-03-14 12:35:57 UTC (rev 26132)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianOS.h 2007-03-14 19:25:33 UTC (rev 26133)
@@ -51,6 +51,7 @@
bool setGraphicsMode(const char *name);
void quitWithErrorMsg(const char *msg);
virtual bool hasFeature(Feature f);
+ void setFeatureState(Feature f, bool enable);
// Set function that generates samples
//
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list