00001 #if !defined(_CINPUT_H_)
00002 #define _CINPUT_H_
00003
00004 #include "IwGeom.h"
00005 #include "s3ePointer.h"
00006 #include "s3eKeyboard.h"
00007 #include "s3eOSReadString.h"
00008
00009 #define MAX_TOUCHES 4
00010
00011
00012
00013
00014
00015
00016 struct CTouch
00017 {
00018 public:
00019 int x, y;
00020 bool active;
00021 int id;
00022 };
00023
00024
00025
00026
00027
00028
00029 class CInput
00030 {
00031
00032 private:
00033 bool PointerAvailable;
00034 bool KeysAvailable;
00035 bool OSKeyboardAvailable;
00036 bool IsMultiTouch;
00037 CTouch Touches[MAX_TOUCHES];
00038 public:
00039 bool isPointerAvailable() const { return PointerAvailable; }
00040 bool isKeysAvailable() const { return KeysAvailable; }
00041 bool isOSKeyboardAvailable() const { return OSKeyboardAvailable; }
00042 bool isMultiTouch() const { return IsMultiTouch; }
00043 CTouch* getTouchByID(int id);
00044 CTouch* getTouch(int index) { return &Touches[index]; }
00045 CTouch* findTouch(int id);
00046 int getTouchCount() const;
00047 bool isKeyDown(s3eKey key) const;
00048 bool isKeyUp(s3eKey key) const;
00049 bool wasKeyPressed(s3eKey key) const;
00050 bool wasKeyReleased(s3eKey key) const;
00051 const char* showOnScreenKeyboard(const char* prompt, int flags = 0, const char* default_text = NULL);
00052
00053
00054 private:
00055 public:
00056 bool Init();
00057 void Release();
00058 void Update();
00059 };
00060
00061 extern CInput g_Input;
00062
00063
00064
00065 #endif // _CINPUT_H_