inp_joystick_linux.hh

Go to the documentation of this file.
00001 /*
00012  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00013  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00014  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00015  *****************************************************************************/
00016 
00017 #if __linux__ || OS_FREEBSD
00018 #ifndef INP_JOYSTICK_LINUX_HH
00019 #define INP_JOYSTICK_LINUX_HH 1
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 namespace inp {
00031 
00032 class Global;
00033 
00037 class JoystickLinux : public Joystick
00038 {
00039 
00040 friend class Global;
00041 
00042 private:
00044     enum
00045     {
00046         eLinuxAxis_LEFT_RIGHT = 0,
00047         eLinuxAxis_UP_DOWN    = 1,
00048         eLinuxAxis_THIRD      = 2,
00049     };
00050 
00051 private:
00052             // Joystick is meant to be instantiated once as a member of Global.
00053             JoystickLinux( void );
00054             ~JoystickLinux();
00055 
00056 public:
00057     void    PrintStatus( void );
00058 
00059 private:
00060     bool    Open( void );
00061     void    Close( void );
00062     bool    PollEvent( Event& event /*OUT*/ );
00063 
00064 private:
00065     const string    mDeviceName;
00066     const string    mDeviceName2;   // alternate name
00067     int             mFiledesc;      // joystick device file
00068 };
00069 
00070 } // namespace inp
00071 
00072 #endif // INP_JOYSTICK_LINUX_HH
00073 #endif // __linux__ || OS_FREEBSD
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:11 2007