globalkeycapture.h

来自「s60平台下捕获全局按键的方法--含源代码。对要捕获symbian下的全局按键有」· C头文件 代码 · 共 87 行

H
87
字号
/*
* ============================================================================
*  Name     :  GlobalKeyCapture.h
*  Part of  : GlobalKeyCapture
*  Created  : 11.09.2005 by Artem Marchenko
*  Description:
*     GlobalKeyCapture.h - header file
*  Version  :
*  Copyright: 2005 Artem Marchenko
* ============================================================================
*/


#ifndef __GLOBALKEYCAPTURE_H__
#define __GLOBALKEYCAPTURE_H__


//  Include Files

#include <e32base.h>
#include <w32std.h>  // RWsSession

// Forward declarations
class RWindowGroup;
class CApaWindowGroupName;

/** 
 * Registers itself for event capturing.
 * Is notified about events via CActive calls
 */
class CGlobalCapturer : public CActive 
	{
	public:
		// New functions

	    /** 
		 * Registers itself for the key press events
		 * @leave Symbian standard leave codes
		 */
		void StartCapturingL();
		~CGlobalCapturer();
		CGlobalCapturer();
	public:
		// From CActive

		/**
		 * Is called by active scheduler when key press happens
		 */
		void RunL();
	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;

		// Number of keypresses already captured
		TInt iCaptureCounter;
	};


//  Function Prototypes

#ifdef __WINS__
IMPORT_C TInt WinsMain(TAny* aParam);
#else
GLDEF_C TInt E32Main();
#endif


#endif  // __GLOBALKEYCAPTURE_H__

// End of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?