uifw/AvKon/animdllsrc/AknAnimKeySound.cpp
branchRCL_3
changeset 18 fcdfafb36fe7
parent 0 2f259fa3e83a
child 19 aecbbf00d063
equal deleted inserted replaced
17:a1caeb42b3a3 18:fcdfafb36fe7
   256     if (iFeatureNoPowerKey)
   256     if (iFeatureNoPowerKey)
   257         {
   257         {
   258         iPendingEvent = CAknPendingKeyEvent::NewL(iFunctions, iNoPowerKeyScanCode);
   258         iPendingEvent = CAknPendingKeyEvent::NewL(iFunctions, iNoPowerKeyScanCode);
   259         }
   259         }
   260 
   260 
       
   261     
       
   262     iSupportQuertyKey = 
       
   263                FeatureManager::FeatureSupported( KFeatureIdQwertyInput );
       
   264     
   261     FeatureManager::UnInitializeLib();
   265     FeatureManager::UnInitializeLib();
   262     
   266     
   263     // Get extension for querying and manipulating the window and screen attributes.
   267     // Get extension for querying and manipulating the window and screen attributes.
   264     iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(
   268     iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(
   265         MAnimGeneralFunctions::EWindowExtensionInterface)); 
   269         MAnimGeneralFunctions::EWindowExtensionInterface)); 
   285 
   289 
   286 // -----------------------------------------------------------------------------
   290 // -----------------------------------------------------------------------------
   287 // CAknAnimKeySound::IsBlockedKeyCode
   291 // CAknAnimKeySound::IsBlockedKeyCode
   288 // -----------------------------------------------------------------------------
   292 // -----------------------------------------------------------------------------
   289 //
   293 //
   290 TBool CAknAnimKeySound::IsBlockedKeyCode( TInt aScanCode )
   294 TBool CAknAnimKeySound::IsBlockedKeyCode( TBool aSupportQuerty , TInt aScanCode )  
   291     {
   295     {
       
   296     if( aSupportQuerty )
       
   297         {
       
   298         return EFalse;
       
   299         }
   292     for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ )
   300     for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ )
   293         {
   301         {
   294         if ( aScanCode == KBlockedKeyCodes[ii] )
   302         if ( aScanCode == KBlockedKeyCodes[ii] )
   295             {
   303             {
   296             return ETrue;
   304             return ETrue;
   736         {
   744         {
   737         case TRawEvent::EKeyDown:
   745         case TRawEvent::EKeyDown:
   738             {
   746             {
   739             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   747             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   740             if ( !NonBlockedKeyCode( scan ) 
   748             if ( !NonBlockedKeyCode( scan ) 
   741                 && iKeyPressed && iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   749                 && iKeyPressed && iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   742                 {
   750                 {
   743                 blockEvent = ETrue;
   751                 blockEvent = ETrue;
   744                 }
   752                 }
   745             else
   753             else
   746                 {
   754                 {
   762 
   770 
   763         case TRawEvent::EKeyRepeat:
   771         case TRawEvent::EKeyRepeat:
   764             {
   772             {
   765             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   773             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   766             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   774             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   767                  iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   775                  iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   768                 {
   776                 {
   769                 // If down event is not passed forward, then 
   777                 // If down event is not passed forward, then 
   770                 // repeat events are not passed either.
   778                 // repeat events are not passed either.
   771                 blockEvent = ETrue;
   779                 blockEvent = ETrue;
   772                 }
   780                 }
   775             
   783             
   776         case TRawEvent::EKeyUp:
   784         case TRawEvent::EKeyUp:
   777             {
   785             {
   778             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   786             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   779             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   787             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   780                  iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   788                  iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   781                 {
   789                 {
   782                 // Do not need to block key-up events - there's not a problem 
   790                 // Do not need to block key-up events - there's not a problem 
   783                 // if there's an unexpected key-up events delivery to an app
   791                 // if there's an unexpected key-up events delivery to an app
   784                 }
   792                 }
   785             else
   793             else