Namespaces
Variants
Actions

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

Jump to: navigation, search
Archived.png
Archived: 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

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 08:55.
119 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved