📄 directinput.h
字号:
//=============================================================================
// DirectInput.h by Frank Luna (C) 2005 All Rights Reserved.
//
// Wraps initialization of immediate mode Direct Input, and provides
// information for querying the state of the keyboard and mouse.
//=============================================================================
#ifndef DIRECT_INPUT_H
#define DIRECT_INPUT_H
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
class DirectInput
{
public:
DirectInput(DWORD keyboardCoopFlags, DWORD mouseCoopFlags);
~DirectInput();
void poll();
bool keyDown(char key);
bool mouseButtonDown(int button);
float mouseDX();
float mouseDY();
float mouseDZ();
private:
// Make private to prevent copying of members of this class.
DirectInput(const DirectInput& rhs);
DirectInput& operator=(const DirectInput& rhs);
private:
IDirectInput8* mDInput;
IDirectInputDevice8* mKeyboard;
char mKeyboardState[256];
IDirectInputDevice8* mMouse;
DIMOUSESTATE2 mMouseState;
};
extern DirectInput* gDInput;
#endif // DIRECT_INPUT_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -