📄 input.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -