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.

捕捉S60第三版FP2的通话/挂机键

From Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台: S60 3rd Edition FP2
S60 3rd Edition FP2

平台安全性
需要的签名: DevCert
能力: SwEvent

文章
翻译:
hoolee
最后由 hamishwillee 在 07 Aug 2012 编辑

描述

使用下列代码可以捕捉S60手机长按挂机键的事件:

 // Capture events from end key
CCoeEnv::Static()->RootWin().CaptureKey( EKeyPhoneEnd, 0, 0 ) ;
CCoeEnv::Static()->RootWin().CaptureKeyUpAndDowns( EStdKeyNo, 0, 0 );

上述代码片段在S60第三版和第三版FP1手机上工作正常,但在FP2手机上,却无法捕捉到相应事件,这是因为优先级未定义或级别太低的缘故。


解决方案

下列函数中,重载相关函数以便接收优先级参数:

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

第三版FP2手机,需要超过EPriorityFileServer级别的优先级才能捕捉到接听和挂机键

This page was last modified on 7 August 2012, at 00:20.
158 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.

×