📄 mguardkeycapture.h
字号:
/*
* ============================================================================
* Name : MGuardKeyCapture.h
* Part of : MGuard
* Created : July 21 2007 by xueyw
* Description:
* Copyright:
* ============================================================================
*/
#ifndef __MGUARDKEYCAPTURE_H__
#define __MGUARDKEYCAPTURE_H__
// Include Files
#include <e32base.h>
#include <w32std.h> // RWsSession
// Forward declarations
class RWindowGroup;
class CApaWindowGroupName;
class CGuardKeyCapturer : public CActive
{
public:
// New functions
/**
* Registers itself for the key press events
* @leave Symbian standard leave codes
*/
void StartCapturingL();
void StopCapturingL();
void ResumeCapturingL();
~CGuardKeyCapturer();
public:
CGuardKeyCapturer();
public:
// From CActive
/**
* Is called by active scheduler when key press happens
*/
void RunL();
public:
TBool IsCaptureStarted()
{
return iCaptureStarted; }
TBool IsCatpurePending()
{
return iCapturePending;
}
enum
{
EMaxKeyCount = 160
};
protected:
/**
* Is called when event listening should be stopped
*/
virtual void DoCancel();
private:
// Data
// Session to the window server
RWsSession iWsSession;
// Window group created to listed to the events
RWindowGroup* iWindowGroup;
// Is used to hide window from the task switcher
CApaWindowGroupName* iWindowGroupName;
// Handle to the capturing request
TInt32 iCaptureHandle[EMaxKeyCount];
TInt iCaptureHandleCount;
// Handle to the second capturing request
TInt32 iLongCaptureHandle;
// Number of keypresses already captured
TInt iCaptureCounter;
TBool iCaptureStarted;
TBool iCapturePending;
};
#endif // __MGUARDKEYCAPTURE_H__
// End of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -