×
Namespaces

Variants
Actions

通话中捕获结束(红)键

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
dougcn 在 27 Jun 2008 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

平台:

S60 3rd Edition

S60 3rd Edition, FP1

使用下面的代码,即使在通话中应用程序也能捕获结束(红)键:

请注意: SwEvent能力是必须的,以便成功调用涉及到的Window Server函数。

#include <W32STD.H> // link against ws32.lib
 
#include <e32keys.h>
 
...
 
RWindowGroup& groupWin = CCoeEnv::Static()->RootWin();
 
TInt endKey1 = groupWin.CaptureKeyUpAndDowns( EStdKeyNo, 0, 0 );
 
TInt endKey2 = groupWin.CaptureKey( EKeyNo, 0, 0 );
 
// -> End key can now be processed before the phone application of the device...
 
...
 
// Cancel the capture
 
groupWin.CancelCaptureKeyUpAndDowns( endKey1 );
 
groupWin.CancelCaptureKey( endKey2 );

本解决办法已用Nokia N73(SW: 2.0620.0.05)测试过。

This page was last modified on 15 December 2011, at 08:43.
53 page views in the last 30 days.