inp_keyboard.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00011  *****************************************************************************/
00012 
00013 #ifndef INP_KEYBOARD_HH
00014 #define INP_KEYBOARD_HH 1
00015 
00016 namespace inp {
00017 
00024 class Keyboard
00025 {
00026 
00027 public:
00031     class Event
00032     {
00033     public:
00034             Event( void )
00035             : mKey(0), mSpecial(0), mPress(0), mShift(0), mCtrl(0), mAlt(0)
00036             { }
00037 
00038             Event( int key, bool special, bool press, bool shift, bool ctrl, bool alt )
00039             : mKey(key), mSpecial(special), mPress(press), mShift(shift), mCtrl(ctrl), mAlt(alt)
00040             { }
00041 
00042             bool IfModifier( void ) const { return mShift || mCtrl || mAlt; }
00043     public:
00044         int     mKey;       // which key (one of eGfxKey_*)
00045         bool    mSpecial;   // true if a special key such as F1, HOME, etc
00046         bool    mPress;     // true if key was pressed, else key was released
00047         bool    mShift;     // true if Shift was down
00048         bool    mCtrl;      // true if Ctrl was down
00049         bool    mAlt;       // true if Alt was down
00050     };
00051 
00052 protected:
00053     // Only derivative can construct this (not even Global).
00054                 Keyboard( void ) { }
00055     virtual     ~Keyboard() { }
00056 
00057 public:
00058     virtual void Enable( void ) = 0;
00059 };
00060 
00061 } // namespace inp
00062 
00063 #endif // INP_KEYBOARD_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:11 2007