cinput.h

来自「HeightMap_D3D」· C头文件 代码 · 共 53 行

H
53
字号
//-----------------------------------------------------------------------------
// File: cInput.h
// Desc: Header file for the DirectInput. All the DI class is declared here.
//-----------------------------------------------------------------------------
#ifndef cInput_h
#define cInput_h

#define DIM_LEFT 0
#define DIM_RIGHT 1
#define DIM_MIDDLE 2
#define DIM_4 3
#define DIM_5 4
#define DIM_6 5
#define DIM_7 6
#define DIM_8 7

struct CURSOR_VERTEX
{
	int fX, fY;
};

class cInput
{
public:
	cInput();
	HRESULT InitDI();
	HRESULT InitDIKB();
	HRESULT InitDIMouse();

	HRESULT GetDeviceState();
	HRESULT Render();

	HRESULT BKeyDown(int Key);
	HRESULT MKeyDown(int Key);

	int getMPosX() { return MPos.fX; };
	int getMPosY() { return MPos.fY; };

	long getM_BuffX() { return M_Buffer.lX; };
	long getM_BuffY() { return M_Buffer.lY; };
	long getM_BuffZ() { return M_Buffer.lZ; };

	~cInput();
private:
	LPDIRECTINPUT8 m_lpDI;
	LPDIRECTINPUTDEVICE8 m_lpDIKB;
	LPDIRECTINPUTDEVICE8 m_lpDIMouse;

	char chKB_Buffer[256];
	DIMOUSESTATE M_Buffer;
	CURSOR_VERTEX MPos;
};
#endif

⌨️ 快捷键说明

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