捕捉S60第三版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级别的优先级才能捕捉到接听和挂机键


(no comments yet)