Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CAT/CATJoystick.h Source File

CATJoystick.h

Go to the documentation of this file.
00001 /// \file  CATJoystick.h
00002 /// \brief Base Joystick class
00003 /// \ingroup CAT
00004 ///
00005 /// Copyright (c) 2002-2008 by Michael Ellison.
00006 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00007 ///
00008 // $Author: mikeellison $
00009 // $Date: 2008-01-31 09:36:59 -0600 (Thu, 31 Jan 2008) $
00010 // $Revision:   $
00011 // $NoKeywords: $
00012 #ifndef _CATJoystick_H_
00013 #define _CATJoystick_H_
00014 
00015 #include "CATInternal.h"
00016 
00017 const CATUInt32 kCATJOYSTICKBTNMAX = 32;
00018 // Right now, each axis goes from 0 to 100.
00019 struct CATJOYSTICKSTRUCT
00020 {
00021     CATInt32  xAxis;
00022     CATInt32  xLow;
00023     CATInt32  xHigh;
00024     CATInt32  yAxis;
00025     CATInt32  yLow;
00026     CATInt32  yHigh;
00027     CATInt32  zAxis;
00028     CATInt32  zLow;
00029     CATInt32  zHigh;
00030     CATInt32  xRot;
00031     CATInt32  xRotLow;
00032     CATInt32  xRotHigh;
00033     CATInt32  yRot;
00034     CATInt32  yRotLow;
00035     CATInt32  yRotHigh;
00036     CATInt32  zRot;
00037     CATInt32  zRotLow;
00038     CATInt32  zRotHigh;
00039     CATInt32  xPov;
00040     CATInt32  xPovLow;
00041     CATInt32  xPovHigh;
00042     CATInt32  yPov;
00043     CATInt32  yPovLow;
00044     CATInt32  yPovHigh;
00045     CATUInt32 buttonMap;    
00046 };
00047 
00048 class CATJoystick
00049 {
00050     public:
00051                 
00052         // Axis types for input device
00053         enum AXIS_TYPE
00054         {
00055             X_AXIS      = 0x00000001,
00056             X_AXIS_LOW  = 0x00000002,
00057             X_AXIS_HIGH = 0x00000004,
00058             Y_AXIS      = 0x00000008,
00059             Y_AXIS_LOW  = 0x00000010,
00060             Y_AXIS_HIGH = 0x00000020,
00061             Z_AXIS      = 0x00000040,
00062             Z_AXIS_LOW  = 0x00000080,
00063             Z_AXIS_HIGH = 0x00000100,
00064             X_ROT       = 0x00000200,
00065             X_ROT_LOW   = 0x00000400,
00066             X_ROT_HIGH  = 0x00000800,
00067             Y_ROT       = 0x00001000,
00068             Y_ROT_LOW   = 0x00002000,
00069             Y_ROT_HIGH  = 0x00004000,
00070             Z_ROT       = 0x00008000,
00071             Z_ROT_LOW   = 0x00010000,
00072             Z_ROT_HIGH  = 0x00020000,
00073             X_POV       = 0x00040000,
00074             X_POV_LOW   = 0x00080000,
00075             X_POV_HIGH  = 0x00100000,
00076             Y_POV       = 0x00200000,
00077             Y_POV_LOW   = 0x00400000,
00078             Y_POV_HIGH  = 0x00800000
00079         };
00080 
00081         CATJoystick();
00082         virtual ~CATJoystick();     
00083 
00084 
00085         // Retrieve bitmapped valid axis
00086         virtual CATUInt32 GetValidAxis();
00087 
00088         // Configure the joystick(s)
00089         virtual bool            GetStatus(CATJOYSTICKSTRUCT& status) = 0;
00090         virtual bool            Configure(HWND hwnd)                 = 0;
00091         
00092         static  const CATWChar*  GetAxisName(AXIS_TYPE axisType);
00093 
00094     protected:
00095         CATUInt32   fValidAxis;
00096         
00097 };
00098 
00099 #endif // _CATJoystick_H_

Generated on Mon Feb 11 04:09:44 2008 for Game Accessibility Suite by doxygen 1.5.4