Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Capturing Send and End key events fails on S60 3rd Edition FP2 (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 3rd Edition FP2
S60 3rd Edition FP2
Platform Security
Capabilities: SwEvent
Article
Keywords: CaptureKey, CaptureKeyUpAndDowns
Created: User:Kbwiki (08 Feb 2010)
Last edited: hamishwillee (18 Sep 2012)

Description

Capturing events from a long press of the End (red) key on S60 devices can be done using the following code snippet:

 // Capture events from end key (SwEvent capability required)
iKeyHandle1 = CCoeEnv::Static()->RootWin().CaptureKey( EKeyPhoneEnd, 0, 0 ) ;
iKeyHandle2 = CCoeEnv::Static()->RootWin().CaptureKeyUpAndDowns( EStdKeyNo, 0, 0 );
 
...
 
// Release captured keys
CCoeEnv::Static()->RootWin().CancelCaptureKey( iKeyHandle1 );
CCoeEnv::Static()->RootWin().CancelCaptureKey( iKeyHandle2 );

This code snippet works fine on S60 3rd Edition and 3rd Edition, FP1 devices, as well as on S60 5th Edition touch devices. However, on S60 3rd Edition, FP2 devices, capturing the events will fail if the priority is not defined or is too low.


Solution

For the above functions, use overloaded versions that take priority as a parameter:

 TInt32 CaptureKey( TUint aKeycode, TUint aModifierMask, 
TUint aModifier, TInt aPriority );
 
TInt32 CaptureKeyUpAndDowns( TUint aScanCode, TUint aModifierMask,
TUint aModifier, TInt aPriority );


For S60 3rd Edition, FP2 devices, capturing events from the Send/End keys is possible by using a priority value higher than EPriorityFileServer.

This page was last modified on 18 September 2012, at 05:55.
491 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×