1 // InputTask.h: interface for the CInputTask class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
5 #if !defined(AFX_KEYBOARDTASK_H__4953EF06_7C18_4433_B590_47E045E43576__INCLUDED_)
\r
6 #define AFX_KEYBOARDTASK_H__4953EF06_7C18_4433_B590_47E045E43576__INCLUDED_
\r
10 #endif // _MSC_VER > 1000
\r
14 #define DIRECTINPUT_VERSION 0x0800
\r
18 class CInputTask : public ITask
\r
22 virtual ~CInputTask();
\r
28 static BYTE keys[256], oldKeys[256];
\r
29 //static CMMPointer<CMMDynamicBlob<unsigned char> > oldKeys;
\r
30 //static int keyCount;
\r
33 static unsigned int buttons;
\r
34 static unsigned int oldButtons;
\r
36 static bool inline curKey(int index) { return (keys[index] & 0x80) != 0; }
\r
37 static bool inline oldKey(int index) { return (oldKeys[index] & 0x80) != 0; }
\r
39 //some helper functions to make certain things easier
\r
40 //static bool inline keyDown(int index) { return ( curKey(index))&&(!oldKey(index)); }
\r
41 static bool inline keyDown(int index) { return ( curKey(index)); }
\r
42 static bool inline keyStillDown(int index) { return ( curKey(index))&&( oldKey(index)); }
\r
43 static bool inline keyUp(int index) { return (!curKey(index))&&( oldKey(index)); }
\r
44 static bool inline keyStillUp(int index) { return (!curKey(index))&&(!oldKey(index)); }
\r
46 //static bool inline curMouse(int button) { return (buttons&SDL_BUTTON(button))!=0; }
\r
47 //static bool inline oldMouse(int button) { return (oldButtons&SDL_BUTTON(button))!=0; }
\r
49 //static bool inline mouseDown(int button) { return ( curMouse(button))&&(!oldMouse(button)); }
\r
50 //static bool inline mouseStillDown(int button) { return ( curMouse(button))&&( oldMouse(button)); }
\r
51 //static bool inline mouseUp(int button) { return (!curMouse(button))&&( oldMouse(button)); }
\r
52 //static bool inline mouseStillUp(int button) { return (!curMouse(button))&&(!oldMouse(button)); }
\r
57 LPDIRECTINPUT8 din; // the pointer to our DirectInput interface
\r
58 LPDIRECTINPUTDEVICE8 dinkeyboard; // the pointer to the keyboard device
\r
62 #endif // !defined(AFX_KEYBOARDTASK_H__4953EF06_7C18_4433_B590_47E045E43576__INCLUDED_)
\r