00001 /// \file CATJoystick.cpp 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 #include "CATJoystick.h" 00013 00014 00015 CATJoystick::CATJoystick() 00016 { 00017 fValidAxis = 0; 00018 } 00019 00020 00021 CATJoystick::~CATJoystick() 00022 { 00023 00024 00025 } 00026 00027 CATUInt32 CATJoystick::GetValidAxis() 00028 { 00029 return fValidAxis; 00030 } 00031 00032 const CATWChar* CATJoystick::GetAxisName(CATJoystick::AXIS_TYPE axisType) 00033 { 00034 CATWChar* axisName = L"Undefined Axis"; 00035 switch (axisType) 00036 { 00037 case X_AXIS: axisName = L"X"; break; 00038 case X_AXIS_LOW: axisName = L"X (L)";break; 00039 case X_AXIS_HIGH: axisName = L"X (H)";break; 00040 case Y_AXIS: axisName = L"Y";break; 00041 case Y_AXIS_LOW: axisName = L"Y (L)";break; 00042 case Y_AXIS_HIGH: axisName = L"Y (H)";break; 00043 case Z_AXIS: axisName = L"Z";break; 00044 case Z_AXIS_LOW: axisName = L"Z (L)";break; 00045 case Z_AXIS_HIGH: axisName = L"Z (H)";break; 00046 case X_ROT: axisName = L"rX";break; 00047 case X_ROT_LOW: axisName = L"rX (L)";break; 00048 case X_ROT_HIGH: axisName = L"rX (H)";break; 00049 case Y_ROT: axisName = L"rY";break; 00050 case Y_ROT_LOW: axisName = L"rY (L)";break; 00051 case Y_ROT_HIGH: axisName = L"rY (H)";break; 00052 case Z_ROT: axisName = L"rZ";break; 00053 case Z_ROT_LOW: axisName = L"rZ (L)";break; 00054 case Z_ROT_HIGH: axisName = L"rZ (H)";break; 00055 case X_POV_LOW: axisName = L"povX (L)";break; 00056 case X_POV_HIGH: axisName = L"povX (H)";break; 00057 case Y_POV_LOW: axisName = L"povY (L)";break; 00058 case Y_POV_HIGH: axisName = L"povY (H)";break; 00059 } 00060 return axisName; 00061 }