From 060acd45187857e29a682dd30e5d529e61fbfa1e Mon Sep 17 00:00:00 2001 From: gewlitys Date: Mon, 13 Oct 2008 20:42:22 +0000 Subject: [PATCH] Added special mapping for starmap zoom keys. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3089 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/symbian/uqmapp.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/sc2/src/symbian/uqmapp.cpp b/sc2/src/symbian/uqmapp.cpp index ed699bfef..32478a446 100644 --- a/sc2/src/symbian/uqmapp.cpp +++ b/sc2/src/symbian/uqmapp.cpp @@ -8,15 +8,22 @@ #include #include #include +#include const TUid KUidSdlApp={ 0xA000A0C3 }; +class CSDL; class CSDLObserver : public CBase, public MSDLObserver { public: + CSDLObserver(CSDL* aSdl); + TInt SdlEvent(TInt aEvent, TInt aParam); TInt SdlThreadEvent(TInt aEvent, TInt aParam); + +private: + CSDL* iSdl; }; class MExitWait @@ -146,7 +153,7 @@ void CSdlAppUi::ConstructL() iSDLWin->ConstructL(ApplicationRect()); iSdl = CSDL::NewL(CSDL::EEnableFocusStop); - iSdlObserver = new (ELeave) CSDLObserver; + iSdlObserver = new (ELeave) CSDLObserver(iSdl); iSdl->SetContainerWindowL( iSDLWin->GetWindow(), @@ -179,7 +186,7 @@ void CSdlAppUi::HandleCommandL(TInt aCommand) } void CSdlAppUi::DoExit(TInt aErr) - { + { delete iSdl; iSdl = NULL; @@ -247,9 +254,19 @@ GLDEF_C TInt E32Main() { return EikStart::RunApplication(NewApplication); } - + +CSDLObserver::CSDLObserver(CSDL* aSdl) : iSdl(aSdl) +{ +} + TInt CSDLObserver::SdlEvent(TInt aEvent, TInt aParam) { + if (aEvent == EEventKeyMapInit) + { + // starmap zoom + iSdl->SetSDLCode('3', SDLK_KP_PLUS); + iSdl->SetSDLCode('2', SDLK_KP_MINUS); + } return 0; }