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 |