phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp
branchRCL_3
changeset 58 40a3f856b14d
parent 57 94dc1107e8b2
equal deleted inserted replaced
57:94dc1107e8b2 58:40a3f856b14d
   154     // After event key, expect to have key up event.
   154     // After event key, expect to have key up event.
   155     iExpectKeyUpEvent = ( aType == EEventKey );
   155     iExpectKeyUpEvent = ( aType == EEventKey );
   156 
   156 
   157     ret = OfferKeyEventBeforeControlStackL( aKeyEvent, aType );
   157     ret = OfferKeyEventBeforeControlStackL( aKeyEvent, aType );
   158 
   158 
   159     if ( !aKeyEvent.iRepeats )
   159     if ( !aKeyEvent.iRepeats && aKeyEvent.iCode != EKeyEscape )
   160         {
   160         {
   161         // Convert event. Use already converted iKeyPressedDown.
   161         // Convert event. Use already converted iKeyPressedDown.
   162         TKeyEvent keyEvent = aKeyEvent;
   162         TKeyEvent keyEvent = aKeyEvent;
   163         keyEvent.iCode = iKeyPressedDown;
   163         if ( keyEvent.iScanCode == EStdKeyApplication0 )
       
   164             {
       
   165             keyEvent.iCode = EKeyApplication0;
       
   166             }
       
   167         else
       
   168             {
       
   169             keyEvent.iCode = iKeyPressedDown;
       
   170             }
   164         
   171         
   165         // Do not handle dtmf tone if the type is EEventKey but we are not
   172         // Do not handle dtmf tone if the type is EEventKey but we are not
   166         // expecting key up event. This happens if the key up event has been
   173         // expecting key up event. This happens if the key up event has been
   167         // handled by some CActiveSchedulerWait object somewhere in the execution 
   174         // handled by some CActiveSchedulerWait object somewhere in the execution 
   168         // of function OfferKeyEventBeforeControlStackL.
   175         // of function OfferKeyEventBeforeControlStackL.
   531     // value for menubar, so ask visibility also from CEikMenuBar
   538     // value for menubar, so ask visibility also from CEikMenuBar
   532     iDisplayingMenuOrDialogOnEventKeyDown = ( iViewCommandHandle->HandleCommandL(
   539     iDisplayingMenuOrDialogOnEventKeyDown = ( iViewCommandHandle->HandleCommandL(
   533             EPhoneViewIsDisplayingMenuOrDialog ) == 
   540             EPhoneViewIsDisplayingMenuOrDialog ) == 
   534             EPhoneViewResponseSuccess ) || ( iMenu && iMenu->IsDisplayed() );
   541             EPhoneViewResponseSuccess ) || ( iMenu && iMenu->IsDisplayed() );
   535 
   542 
   536     // Consume dialer simulated key events, pass others on
   543 
   537     return ( IsKeySimulatedByTouchDialer( aKeyEvent ) ? EKeyWasConsumed : EKeyWasNotConsumed );
   544     return ( EKeyWasNotConsumed );
   538     }
   545     }
   539 
   546 
   540 // -----------------------------------------------------------
   547 // -----------------------------------------------------------
   541 // CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL
   548 // CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL
   542 // Both short key press event (iRepeats == 0) and
   549 // Both short key press event (iRepeats == 0) and
   644 
   651 
   645     // Store the previous scan code
   652     // Store the previous scan code
   646     iPreviousScanCode = iScanCode;
   653     iPreviousScanCode = iScanCode;
   647 
   654 
   648     // Consume dialer simulated key events, pass others on
   655     // Consume dialer simulated key events, pass others on
   649     return ( IsKeySimulatedByTouchDialer( aKeyEvent ) ? EKeyWasConsumed : EKeyWasNotConsumed );
   656     return EKeyWasNotConsumed;
   650     }
   657     }
   651 
   658 
   652 // ---------------------------------------------------------
   659 // ---------------------------------------------------------
   653 // CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallback
   660 // CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallback
   654 //
   661 //