phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp
branchRCL_3
changeset 6 38529f706030
parent 5 2a26698d78ba
child 7 544e34b3255a
equal deleted inserted replaced
5:2a26698d78ba 6:38529f706030
    29 #include "cphonekeyeventforwarder.h"
    29 #include "cphonekeyeventforwarder.h"
    30 #include "cphonepubsubproxy.h"
    30 #include "cphonepubsubproxy.h"
    31 #include "cphonetimer.h"
    31 #include "cphonetimer.h"
    32 #include "phonelogger.h"
    32 #include "phonelogger.h"
    33 #include "phoneui.pan"
    33 #include "phoneui.pan"
       
    34 #include "mphoneviewcommandhandle.h"
       
    35 #include "cphoneqwertyhandler.h"
       
    36 #include "tphonecmdparampointer.h"
       
    37 #include "mphoneqwertymodeobserver.h"
       
    38 #include "cdialer.h"
    34 
    39 
    35 // CONSTANTS
    40 // CONSTANTS
    36 
    41 
    37 //Avkon P&S keys
    42 //Avkon P&S keys
    38 const TUid KCRUidAvkon = { 0x101F876E };
    43 const TUid KCRUidAvkon = { 0x101F876E };
    71     if( env )
    76     if( env )
    72         {
    77         {
    73         env->EikAppUi()->RemoveFromStack( this );
    78         env->EikAppUi()->RemoveFromStack( this );
    74         }
    79         }
    75     delete iLongPressKeyEventTimer;
    80     delete iLongPressKeyEventTimer;
       
    81     
       
    82     delete iQwertyHandler;
    76     }
    83     }
    77 
    84 
    78 // -----------------------------------------------------------------------------
    85 // -----------------------------------------------------------------------------
    79 // CPhoneKeyEventForwarder::CountComponentControls
    86 // CPhoneKeyEventForwarder::CountComponentControls
    80 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
   197             ECoeStackFlagRefusesFocus );
   204             ECoeStackFlagRefusesFocus );
   198         }
   205         }
   199 
   206 
   200     // Create the long press key event timer
   207     // Create the long press key event timer
   201     iLongPressKeyEventTimer = CPhoneTimer::NewL();
   208     iLongPressKeyEventTimer = CPhoneTimer::NewL();
       
   209     
       
   210     // Create qwerty mode handler
       
   211     iQwertyHandler = CPhoneQwertyHandler::NewL(); 
       
   212     
       
   213     TPhoneCmdParamPointer ptrParam;
       
   214     iViewCommandHandle->ExecuteCommand( EPhoneViewGetQwertyModeObserver, &ptrParam );
       
   215     CDialer* qwertyObserver = 
       
   216             static_cast<CDialer*>( ptrParam.Pointer() );
       
   217             
       
   218     iQwertyHandler->AddQwertyModeObserverL( *qwertyObserver );
       
   219 
   202     }
   220     }
   203 
   221 
   204 // -----------------------------------------------------------------------------
   222 // -----------------------------------------------------------------------------
   205 // CPhoneKeyEventForwarder::IsAlphaNumericKey
   223 // CPhoneKeyEventForwarder::IsAlphaNumericKey
   206 // -----------------------------------------------------------------------------
   224 // -----------------------------------------------------------------------------
   292             response = HandleEventKeyUpBeforeControlStackL( aKeyEvent );
   310             response = HandleEventKeyUpBeforeControlStackL( aKeyEvent );
   293             break;
   311             break;
   294         default:
   312         default:
   295             break;
   313             break;
   296         }
   314         }
       
   315     
       
   316     // Check if keyEvent is simulated in Dialer.
       
   317     const TBool simulatedByDialer = 
       
   318         ( ( aKeyEvent.iModifiers & ( EModifierNumLock | EModifierKeypad ) ) 
       
   319                 == ( EModifierNumLock | EModifierKeypad ) );
       
   320     
       
   321     if(  simulatedByDialer && iQwertyHandler->IsQwertyInput() )
       
   322         {
       
   323         // When dialler key was pressed and
       
   324         // qwerty is open and editor is alphanumeric
       
   325         //  -Dont let FEP to handle key events 
       
   326         //    -> Multitapping doesnt work
       
   327         //    -> Numbers are inserted to dialler without modifications
       
   328         // Also effects # / * - key handling 
       
   329         iStateMachine->State()->HandleKeyEventL( aKeyEvent, aType );
       
   330         response = EKeyWasConsumed;
       
   331         }
       
   332     
   297     return response;
   333     return response;
   298     }
   334     }
   299 
   335 
   300 
   336 
   301 // -----------------------------------------------------------------------------
   337 // -----------------------------------------------------------------------------