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

📄 bind.h

📁 我对他如何控制准星、显示敌友很好奇
💻 H
字号:
#include "stringfinder.h"
//===================================================================
class KeyBindManager
{
public:
	typedef void (*CallBack_ExecuteFunc)(const std::string& cmd);
	typedef void (*CallBack_ConTypeFunc)(int c);
	CallBack_ExecuteFunc CallBack_Execute;
	CallBack_ConTypeFunc CallBack_ConType;
	KeyBindManager() 
		: keyNames(256)
		, keyFlags(256)
		, CallBack_Execute(NULL)
		, CallBack_ConType(NULL)
		, con_visible(NULL) 
		, messageMode(false)
	{init();}

	// hooking interface
	void notifyKeyEvent  ( int scancode,  bool down, bool repeat=false); 
	void notifyMouseEvent( char* keyname, bool down ); 
	bool keyBlocked    ( int scancode, bool down );
	bool keyBlocked    ( const char* name );
	int  remapScanCode ( int scancode ) { return keyRemapTable[scancode]; }

	// user interface
	void init( );
	void addBind   (char* key, char* value);
	void save();
	void removeBind(char* key);
	void remapKey(char* from, char* to);
	
	// passthrough flags
	bool messageMode;  
	int  (*con_visible)();



protected:
	void expandCommand(std::string& cmd,bool down);
	BYTE getKeyCode(LPMSG);

	StringFinder myBind;
	std::vector<std::string> myBindExpand;
	std::vector<std::string> keyNames;
	std::vector<int>         keyFlags;

	int   keyRemapTable[256];
	
	typedef unsigned char byte;
	byte  shiftRemap[256];

};
extern KeyBindManager keyBindManager;

⌨️ 快捷键说明

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