phoneapp/phoneui/src/cphoneappui.cpp
branchRCL_3
changeset 6 38529f706030
parent 5 2a26698d78ba
child 9 91c2fb4b78df
equal deleted inserted replaced
5:2a26698d78ba 6:38529f706030
    53 #include "cphonepubsubproxy.h"
    53 #include "cphonepubsubproxy.h"
    54 #include "phonelogger.h"
    54 #include "phonelogger.h"
    55 #include "phoneconstants.h"
    55 #include "phoneconstants.h"
    56 #include "cphoneclearblacklist.h"
    56 #include "cphoneclearblacklist.h"
    57 #include "cphonestatuspane.h"
    57 #include "cphonestatuspane.h"
    58 #include "cphoneqwertyhandler.h"
       
    59 #include "tphonecmdparaminteger.h"
    58 #include "tphonecmdparaminteger.h"
    60 #ifndef __WINS__
    59 #ifndef __WINS__
    61 #include <f32file.h>
    60 #include <f32file.h>
    62 #endif
    61 #endif
    63 
    62 
    88         {
    87         {
    89         RemoveFromStack( iPhoneViewController->PhoneView() );
    88         RemoveFromStack( iPhoneViewController->PhoneView() );
    90         delete iPhoneViewController;
    89         delete iPhoneViewController;
    91         }
    90         }
    92     delete iPhoneUIController;
    91     delete iPhoneUIController;
    93     delete iQwertyHandler;
       
    94     
    92     
    95     CPhoneRecoverySystem::Remove( iStartupSignalRecoveryId );
    93     CPhoneRecoverySystem::Remove( iStartupSignalRecoveryId );
    96 
    94 
    97     delete iEnvChangeNotifier;
    95     delete iEnvChangeNotifier;
    98     iEnvChangeNotifier = NULL;
    96     iEnvChangeNotifier = NULL;
   134     // Push key sounds to sound system.
   132     // Push key sounds to sound system.
   135     CAknKeySoundSystem* keySounds = KeySounds();
   133     CAknKeySoundSystem* keySounds = KeySounds();
   136     keySounds->PushContextL( R_PHONEUI_DEFAULT_SKEY_LIST );
   134     keySounds->PushContextL( R_PHONEUI_DEFAULT_SKEY_LIST );
   137    
   135    
   138     iPhoneViewController = CPhoneViewController::NewL( ClientRect() );
   136     iPhoneViewController = CPhoneViewController::NewL( ClientRect() );
   139     iPhoneUIController = CPhoneUIController::NewL( iPhoneViewController );
   137     iPhoneUIController = CPhoneUIController::NewL( *iPhoneViewController );
   140     iQwertyHandler = CPhoneQwertyHandler::NewL();        
       
   141 
   138 
   142     // Blacklist singleton is initialized here
   139     // Blacklist singleton is initialized here
   143     // return value is ignored since we do not require its services in this class
   140     // return value is ignored since we do not require its services in this class
   144     CPhoneClearBlacklist::CreateL( 
   141     CPhoneClearBlacklist::CreateL( 
   145         iEikonEnv->WsSession(), 
   142         iEikonEnv->WsSession(), 
   599                 if ( keyEvent->iCode == EEikCmdExit )
   596                 if ( keyEvent->iCode == EEikCmdExit )
   600                     {
   597                     {
   601                     Exit();
   598                     Exit();
   602                     return;     
   599                     return;     
   603                     }
   600                     }
   604                            
       
   605                 // Check if key press is simulated by FEP or by touch dialer
       
   606                 TBool fepSimulated = keyEvent->iModifiers & EModifierSpecial;               
       
   607                 TInt modifierMask = ( EModifierNumLock | EModifierKeypad );
       
   608                 TBool dialerSimulated = ( ( keyEvent->iModifiers & modifierMask ) == modifierMask );
       
   609                         
       
   610                 if ( !fepSimulated && !dialerSimulated && iQwertyHandler->IsQwertyInput() )
       
   611                     {
       
   612                     TInt code = iQwertyHandler->NumericKeyCode( *keyEvent );                    
       
   613                     if ( code == EKeyNull && CPhoneKeys::IsNumericKey( *keyEvent, ( TEventCode ) aEvent.Type() ) )
       
   614                         {
       
   615                         code = keyEvent->iCode;
       
   616                         }
       
   617                     
       
   618                     if ( code != EKeyNull ) 
       
   619                         {
       
   620                         // Modify event according to keyboard layout
       
   621                         TWsEvent newWsEvent = aEvent;    
       
   622                         TKeyEvent* newKeyEvent = newWsEvent.Key();
       
   623                         newKeyEvent->iCode = code;
       
   624                         TInt shiftMask = EModifierLeftShift  | 
       
   625                                          EModifierRightShift | 
       
   626                                          EModifierShift;
       
   627                         shiftMask = ~shiftMask;
       
   628                         newKeyEvent->iModifiers = newKeyEvent->iModifiers & shiftMask;
       
   629                         return CAknAppUi::HandleWsEventL( newWsEvent, aDestination );
       
   630                         }
       
   631                     }
       
   632                 }
   601                 }
   633                 break;
   602                 break;
   634                 
   603                 
   635             case EEventKeyUp:
   604             case EEventKeyUp:
   636                 {
   605                 {