Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00038 #ifndef _CE_KEYBOARD_H_
00039 #define _CE_KEYBOARD_H_ 0x1
00041 #ifndef CE_WITHOUT_KEYBOARD
00042
00043 #ifndef __cplusplus
00044 #error ceKeyboard.h requires C++ compilation (use a .cpp suffix)
00045 #endif
00046
00047 #if __GNUC__ >= 0x3
00048 #pragma GCC system_header
00049 #endif
00050
00051 #if _MSC_VER > 1000
00052 #pragma once
00053 #pragma warning(disable: 4100)
00054 #endif
00055
00056 #include "ceInputDevice.h"
00057
00058 #include "ceKeyCodes.h"
00059 #include "begin_code.h"
00060
00061 #define KEYMAP_SCANCODE 0x0 //!< Mapping virtual key to scancode.
00062 #define KEYMAP_VIRTUALKEY 0x3 //!< Mapping scancode to virtual key.
00063
00064 namespace ce {
00065
00066
00067
00068 class IKeyboardDevice;
00069
00076 class DECLSPEC IKeyboardEvent
00077 {
00078 public:
00079
00080 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00081 virtual ~IKeyboardEvent(void) { };
00082 #endif
00083
00094 virtual void APICALL
00095 OnKeyPressed(const IKeyboardDevice *Owner,
00096 const int key, const int buffer[256]) = 0x0;
00097
00108 virtual void APICALL
00109 OnKeyReleased(const IKeyboardDevice *Owner,
00110 const int key, const int buffer[256]) = 0x0;
00111
00118 virtual void APICALL
00119 OnKeyEvent(const IKeyboardDevice *Owner, const int buffer[256]) = 0x0;
00120
00121 };
00122
00123
00124
00125
00126
00134 class DECLSPEC IKeyboardDevice : public IInputDevice
00135 {
00136 public:
00137
00138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00139 virtual ~IKeyboardDevice(void) { };
00140 #endif
00141
00152 virtual int APICALL
00153 IsKeyPressed(const unsigned char key = 0x0) const = 0;
00154
00165 virtual int APICALL
00166 IsKeyReleased(const unsigned char key = 0x0) const = 0;
00167
00168
00169
00170
00171
00172
00173
00174
00188 virtual int APICALL
00189 MapVirtualKey(const unsigned char key,
00190 int map_type = KEYMAP_SCANCODE) const = 0;
00191
00199 virtual int APICALL
00200 GetKeyboardState(int buffer[256]) const = 0;
00201
00205 virtual void APICALL
00206 SetKeyboardEvent(IKeyboardEvent *Event) = 0;
00207
00211 virtual IKeyboardEvent* APICALL
00212 GetKeyboardEvent(void) = 0;
00213
00214 };
00215
00216
00217
00218 }
00219
00220 #include "close_code.h"
00221
00222 #if _MSC_VER > 1000
00223 #pragma warning(default:4100)
00224 #endif
00225
00226 #endif // CE_WITHOUT_KEYBOARD
00227 #endif // _CE_KEYBOARD_H_