30 #include "avkoninternalpskeys.h" // KAknIdleAppWindowGroupId |
30 #include "avkoninternalpskeys.h" // KAknIdleAppWindowGroupId |
31 #include <avkondomainpskeys.h> // KAknPowerMenuStatus & KAknEndKeyEvent |
31 #include <avkondomainpskeys.h> // KAknPowerMenuStatus & KAknEndKeyEvent |
32 |
32 |
33 // This is currently nasty set dependencies, API should be moved to middleware layer asap |
33 // This is currently nasty set dependencies, API should be moved to middleware layer asap |
34 #include <ctsydomainpskeys.h> |
34 #include <ctsydomainpskeys.h> |
35 #include <activeidle2domainpskeys.h> |
35 |
36 #include <NetworkHandlingDomainPSKeys.h> |
36 #include <networkhandlingdomainpskeys.h> |
37 #include <PSVariables.h> |
37 #include <PSVariables.h> |
38 |
38 |
39 #include <hwrmlight.h> |
39 #include <hwrmlight.h> |
40 #include <tactilefeedbackserver.h> |
40 #include <tactilefeedbackserver.h> |
41 |
41 |
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 |
|
265 FeatureManager::UnInitializeLib(); |
261 FeatureManager::UnInitializeLib(); |
266 |
262 |
267 // Get extension for querying and manipulating the window and screen attributes. |
263 // Get extension for querying and manipulating the window and screen attributes. |
268 iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface( |
264 iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface( |
269 MAnimGeneralFunctions::EWindowExtensionInterface)); |
265 MAnimGeneralFunctions::EWindowExtensionInterface)); |
289 |
285 |
290 // ----------------------------------------------------------------------------- |
286 // ----------------------------------------------------------------------------- |
291 // CAknAnimKeySound::IsBlockedKeyCode |
287 // CAknAnimKeySound::IsBlockedKeyCode |
292 // ----------------------------------------------------------------------------- |
288 // ----------------------------------------------------------------------------- |
293 // |
289 // |
294 TBool CAknAnimKeySound::IsBlockedKeyCode( TBool aSupportQuerty , TInt aScanCode ) |
290 TBool CAknAnimKeySound::IsBlockedKeyCode( TInt aScanCode ) |
295 { |
291 { |
296 if( aSupportQuerty ) |
|
297 { |
|
298 return EFalse; |
|
299 } |
|
300 for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ ) |
292 for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ ) |
301 { |
293 { |
302 if ( aScanCode == KBlockedKeyCodes[ii] ) |
294 if ( aScanCode == KBlockedKeyCodes[ii] ) |
303 { |
295 { |
304 return ETrue; |
296 return ETrue; |
531 { |
523 { |
532 TInt ps(0), startupOk(0), idle(0); |
524 TInt ps(0), startupOk(0), idle(0); |
533 |
525 |
534 // If system is not in idle or there are calls ongoing, then end key ought to be generated. |
526 // If system is not in idle or there are calls ongoing, then end key ought to be generated. |
535 User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, ps ) ); |
527 User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, ps ) ); |
536 User::LeaveIfError( RProperty::Get( KPSUidAiInformation, KActiveIdleState, idle ) ); |
|
537 User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, startupOk ) ); |
528 User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, startupOk ) ); |
538 |
529 |
539 RDebug::Print(_L("call: %d, idle %d, notes %d"), ps, idle, startupOk); |
530 RDebug::Print(_L("call: %d, idle %d, notes %d"), ps, idle, startupOk); |
540 |
531 |
541 // Call state not yet initialized or startup not yet complete but no emergency call ongoing. |
532 // Call state not yet initialized or startup not yet complete but no emergency call ongoing. |
542 if (ps == EPSCTsyCallStateUninitialized || |
533 if (ps == EPSCTsyCallStateUninitialized || |
543 (ps == EPSCTsyCallStateNone && !startupOk) ) |
534 (ps == EPSCTsyCallStateNone && !startupOk) ) |
544 { |
535 { |
545 return; |
536 return; |
546 } |
537 } |
547 |
|
548 if ( idle == EPSAiForeground ) |
|
549 { |
|
550 // Notify active idle plugins that combined end key / power key has been pressed. |
|
551 RProperty::Set(KPSUidAvkonDomain, KAknEndKeyEvent, 1); |
|
552 } |
|
553 |
|
554 if ( ps != EPSCTsyCallStateNone ) |
538 if ( ps != EPSCTsyCallStateNone ) |
555 { |
539 { |
556 // A phone call is active. |
540 // A phone call is active. |
557 aResult = EEmulateNowPhoneCallActive; |
541 aResult = EEmulateNowPhoneCallActive; |
558 } |
|
559 else if ( idle != EPSAiForeground ) |
|
560 { |
|
561 // We are not in idle view. No active phone calls. |
|
562 aResult = EEmulateNow; |
|
563 } |
542 } |
564 else |
543 else |
565 { |
544 { |
566 // We are in idle view with no active phone calls. |
545 // We are in idle view with no active phone calls. |
567 TInt powerMenuActive(0); |
546 TInt powerMenuActive(0); |
770 |
749 |
771 case TRawEvent::EKeyRepeat: |
750 case TRawEvent::EKeyRepeat: |
772 { |
751 { |
773 TInt scan = aRawEvent.ScanCode() & 0xFFFF; |
752 TInt scan = aRawEvent.ScanCode() & 0xFFFF; |
774 if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && |
753 if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && |
775 iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) ) |
754 iEnableKeyBlock && IsBlockedKeyCode( scan ) ) |
776 { |
755 { |
777 // If down event is not passed forward, then |
756 // If down event is not passed forward, then |
778 // repeat events are not passed either. |
757 // repeat events are not passed either. |
779 blockEvent = ETrue; |
758 blockEvent = ETrue; |
780 } |
759 } |
783 |
762 |
784 case TRawEvent::EKeyUp: |
763 case TRawEvent::EKeyUp: |
785 { |
764 { |
786 TInt scan = aRawEvent.ScanCode() & 0xFFFF; |
765 TInt scan = aRawEvent.ScanCode() & 0xFFFF; |
787 if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && |
766 if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && |
788 iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) ) |
767 iEnableKeyBlock && IsBlockedKeyCode( scan ) ) |
789 { |
768 { |
790 // Do not need to block key-up events - there's not a problem |
769 // Do not need to block key-up events - there's not a problem |
791 // if there's an unexpected key-up events delivery to an app |
770 // if there's an unexpected key-up events delivery to an app |
792 } |
771 } |
793 else |
772 else |