📄 mouse.h
字号:
/*******************************************************************
* Advanced 3D Game Programming using DirectX 7.0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Title: Mouse.h
* Desc: Wrapper of a DirectInput mouse object
*
* copyright (c) 1999 by Adrian Perez
* See license.txt for modification and distribution information
******************************************************************/
#ifndef _MOUSE_H
#define _MOUSE_H
#include <dinput.h>
/**
* Any object that implements this interface can receive input
* from the mouse.
*/
struct iMouseReceiver
{
virtual void MouseMoved( int dx, int dy ){};
virtual void MouseButtonUp( int button ){};
virtual void MouseButtonDown( int button ){};
};
class cMouse
{
LPDIRECTINPUTDEVICE8 m_pDevice;
DIMOUSESTATE m_lastState;
iMouseReceiver* m_pTarget;
public:
cMouse( HWND hWnd, bool bExclusive );
~cMouse();
/**
* Use this to establish a MouseReceiver as the current
* input focus
*/
void SetReceiver( iMouseReceiver* pTarget );
eResult Update();
eResult Acquire();
void UnAcquire();
};
#endif // _MOUSE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -