⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 globalkeycapture.h

📁 演示如何在Symbian系统无UI的程序中捕捉按键。
💻 H
字号:
/*
* ============================================================================
*  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -