home *** CD-ROM | disk | FTP | other *** search
- /*
- Company: Sensaura
- Copyright: (C) 1998
-
- File Name: cdinput.h
- File Description: Header file for declaration of DirectInputObject class
- Author: Adam Philp
- File Version: 1.01.000
- Last Update: 16-OCT-98
-
- Target Compiler: Microsoft Visual C++ Version 5.0
- */
-
- #ifndef __cdinput_h // Sentry, use file only if it's not already included
- #define __cdinput_h
-
- /////////////////////// Included files ////////////////////////////////////////////////////////////
-
- #include <dinput.h>
-
- /////////////////////// Enumerators ///////////////////////////////////////////////////////////////
-
- enum // Enumerate flags representing keys to which this
- { // application responds
- KF_SPACE = 0x00000001,
- KF_UPARROW = 0x00000002,
- KF_PAGEUP = 0x00000004,
- KF_LEFTARROW = 0x00000008,
- KF_RIGHTARROW = 0x00000010,
- KF_DOWNARROW = 0x00000020,
- KF_PAGEDOWN = 0x00000040
- };
-
- /////////////////////// Class declarations ////////////////////////////////////////////////////////
-
- /*
- Class: DirectInputObject
- Description: IDirectInput object support class which manages DirectInput devices
- */
-
- class DirectInputObject
- {
- public: // Public constructor & destructor
- DirectInputObject();
- virtual ~DirectInputObject();
-
- public: // Public member functions
- bool Create(HWND, HINSTANCE);
- void Release();
- bool Update(LPDWORD);
-
- public: // Public data members
- LPDIRECTINPUT m_pDI;
- LPDIRECTINPUTDEVICE m_pKeyboard;
-
- private:
- DWORD TranslateKey(int nKey);
- };
-
- typedef DirectInputObject* LPDIRECTINPUTOBJECT;
-
- #endif // End of sentry __cdinput_h