input.h

来自「Camera的源文件只是一部分Camera的源文件只是一部分」· C头文件 代码 · 共 42 行

H
42
字号
#ifndef DINPUT_H
#define DINPUT_H

//#pragma comment(lib, "dxguid.lib")
//#pragma comment(lib, "dinput8.lib")
#include <dinput.h>
#define MOUSE_X 1
#define MOUSE_Y 2
#define MOUSE_Z 3
#define LBUTTON	4
#define MBUTTON 5
#define RBUTTON 6


class DXInput
{

protected:
	
	LPDIRECTINPUT8		 m_pDInput;
	LPDIRECTINPUTDEVICE8 m_pDInputDeviceKeyboard;
	LPDIRECTINPUTDEVICE8 m_pMouse;


public:
	UCHAR			keyState[256];			//键盘
	DIMOUSESTATE	mousestate;				//鼠标

	DXInput(){m_pDInput=NULL;m_pDInputDeviceKeyboard=NULL;m_pMouse=NULL;}
	//~DXInput();
	HRESULT InitInput(HWND hWnd, HINSTANCE hInst);
	void UpdateInput();
	void Release();

	LONG GetMouseMove(DWORD Axis);
	bool GetMouseButton(DWORD button);

	bool GetKeyboard(DWORD key);

};
#endif

⌨️ 快捷键说明

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