Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

GeneralKeyboard.h

Go to the documentation of this file.
00001 
00002 //
00003 //       Title           : GeneralKeyboard.hpp
00004 //       Project         : OSCAR
00005 //       Created         : Mon Dec  4 15:52:56 1995
00006 //       Author          : Chetan Kapoor
00007 //       Platforms       : 
00008 //       Copyright       : The University of Texas at Austin
00009 //                         All Rights Reserved.
00010 //       Purpose         :
00011 //
00012 //----------------------------------------------------------------------------
00013 //
00014 //       $Revisions$
00015 //
00016 //       $Log: GeneralKeyboard.h,v $
00017 //       Revision 1.4  2005/03/14 21:50:40  pmarch
00018 //       Added to namespace OSCAR and removed "RR" from front of class names.
00019 //
00020 //       Revision 1.3  2004/07/26 22:24:00  chetan
00021 //       Made changes to compile with Warning Level 4 and also under the latest C++ standard
00022 //
00023 //       Revision 1.2  2004/05/27 18:58:06  pmarch
00024 //       Added /defgroup and /ingroup tags.
00025 //
00026 //       Revision 1.1  2003/08/18 21:04:58  pmarch
00027 //       Initial Commit
00028 //
00029 //
00031 
00032 #ifndef GeneralKeyboard_hpp
00033 #define GeneralKeyboard_hpp
00034 
00035 
00036 #include "Base/Base.h"
00037 #include "Base/CommIncludes.h"
00038 #include "Controllers/Controller.h"
00039 #include "Math/Vector.h"
00040 
00041 #ifdef WIN32
00042 #include <conio.h>
00043 #endif
00044 
00045 
00046 const char ESC = 27;
00047 
00049 namespace OSCAR {
00050 
00055   class GeneralKeyboard : public Controller
00056   {
00057   public:
00058     enum BLOCKMODE {NONBLOCK = 0, BLOCK = 1};
00059 
00060     GeneralKeyboard(BLOCKMODE _blockMode = BLOCK);
00061     ~GeneralKeyboard();
00062 
00063     int GetKeyState(char _key);
00064     char GetKey(void);
00065     int SetBlockingMode(enum BLOCKMODE _blockmode);
00066     BLOCKMODE  GetBlockMode(void);
00082     int UpdateVector(Vector& _input, const Vector& _deltas, char _quitKey = ESC);
00083 
00084   protected:
00085     BLOCKMODE  blockMode;
00086     int keyboard;
00087   };
00088 
00089   #include "Controllers/GeneralKeyboard.ipp"
00090 
00091 }
00092 #endif // GeneralKeyboard_hpp
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations