videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp
branchRCL_3
changeset 21 315810614048
parent 16 67eb01668b0e
equal deleted inserted replaced
20:2d690156cf8f 21:315810614048
    14 * Description:  Implementation of playback view's input handler
    14 * Description:  Implementation of playback view's input handler
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 19 %
    19 // Version : %version: 20 %
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <w32std.h> // RWindowBase
    23 #include <w32std.h> // RWindowBase
    24 #include <e32base.h>
    24 #include <e32base.h>
   446 // -------------------------------------------------------------------------------------------------
   446 // -------------------------------------------------------------------------------------------------
   447 //
   447 //
   448 void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
   448 void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent,
   449                                                           TEventCode aType )
   449                                                           TEventCode aType )
   450 {
   450 {
   451     MPX_ENTER_EXIT(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent()"));
   451     MPX_ENTER_EXIT(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent()"),
       
   452                    _L("iProcessingInputType = %d, aType = %d"), iProcessingInputType, aType );
   452 
   453 
   453     switch ( iProcessingInputType )
   454     switch ( iProcessingInputType )
   454     {
   455     {
   455         case EMpxVideoNone:
   456         case EMpxVideoNone:
   456         {
   457         {
   457             if ( aType == EEventKeyDown && IsUserInputAllowed() )
   458             if ( aType == EEventKeyDown && IsUserInputAllowed() )
   458             {
   459             {
   459                 iProcessingInputType = EMpxVideoKeyboard;
   460                 iProcessingInputType = EMpxVideoKeyboard;
   460                 iLastPressedKeyCode = aKeyEvent.iCode;
       
   461                 iLastPressedKeyScanCode = aKeyEvent.iScanCode;
   461                 iLastPressedKeyScanCode = aKeyEvent.iScanCode;
   462 
   462 
   463                 iContainer->DoHandleKeyEventL(aKeyEvent, aType);
   463                 iContainer->DoHandleKeyEventL( aKeyEvent, aType );
   464             }
   464             }
   465             break;
   465             break;
   466         }
   466         }
   467         case EMpxVideoKeyboard:
   467         case EMpxVideoKeyboard:
   468         {
   468         {
   469             if ( aType == EEventKeyUp )
   469             MPX_DEBUG(_L("aKeyEvent.iScanCode = %d, iLastPressedKeyScanCode = %d"),
   470             {
   470                 aKeyEvent.iScanCode, iLastPressedKeyScanCode );
   471                 // only handle up event for the key being handled
   471 
   472                 // ignore spurious key presses
   472             //
   473                 if ( aKeyEvent.iCode == iLastPressedKeyCode  &&
   473             //  Only handle events for the key being handled
   474                      aKeyEvent.iScanCode == iLastPressedKeyScanCode )
   474             //
       
   475             if ( aKeyEvent.iScanCode == iLastPressedKeyScanCode )
       
   476             {
       
   477                 iContainer->DoHandleKeyEventL( aKeyEvent, aType );
       
   478 
       
   479                 if ( aType == EEventKeyUp )
   475                 {
   480                 {
   476                     iContainer->DoHandleKeyEventL(aKeyEvent, aType);
       
   477 
       
   478                     // reset the value only on key up event
       
   479                     iProcessingInputType = EMpxVideoNone;
   481                     iProcessingInputType = EMpxVideoNone;
   480                 }
   482                 }
   481             }
   483             }
       
   484 
   482             break;
   485             break;
   483         }
   486         }
   484     } // switch
   487     } // switch
   485 }
   488 }
   486 
   489