libGizmod/GizmoATIX10.cpp

Go to the documentation of this file.
00001 
00012 /*
00013   
00014   Copyright (c) 2007, Tim Burrell
00015   Licensed under the Apache License, Version 2.0 (the "License");
00016   you may not use this file except in compliance with the License.
00017   You may obtain a copy of the License at 
00018 
00019         http://www.apache.org/licenses/LICENSE-2.0
00020 
00021   Unless required by applicable law or agreed to in writing, software
00022   distributed under the License is distributed on an "AS IS" BASIS,
00023   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   See the License for the specific language governing permissions and 
00025   limitations under the License. 
00026   
00027 */
00028 
00029 #include "GizmoATIX10.hpp"
00030 #include "GizmoEventATIX10.hpp"
00031 #include "../libH/Debug.hpp"
00032 #include "../libH/Exception.hpp"
00033 #include <boost/shared_ptr.hpp>
00034 
00035 using namespace std;
00036 using namespace boost;
00037 using namespace H;
00038 using namespace Gizmod;
00039 
00041 // Type Defs
00043 
00048 #define GIZMO_ATIX10_TYPE       "ATIX10"
00049 
00054 #define GIZMO_ATIX10_EVENTDELAY 0.175f
00055 
00057 // Construction
00059 
00063 GizmoATIX10::GizmoATIX10(const H::DeviceInfo & deviceInfo, int DeviceID, int DeviceClassID) : Gizmo(GIZMO_CLASS_ATIX10, deviceInfo, DeviceID, DeviceClassID), GizmoLinuxInputDevice(deviceInfo) {
00064         setMinimumTimeBetweenEvents(GIZMO_ATIX10_EVENTDELAY);
00065 }
00066 
00070 GizmoATIX10::GizmoATIX10() {
00071         setMinimumTimeBetweenEvents(GIZMO_ATIX10_EVENTDELAY);
00072 }
00073 
00077 GizmoATIX10::~GizmoATIX10() {
00078 }
00079 
00081 // Class Body
00083 
00088 std::string GizmoATIX10::getType() {
00089         return GIZMO_ATIX10_TYPE;
00090 }
00091 
00097 bool GizmoATIX10::processEvent(GizmoEvent * pEvent) {
00098         if (!GizmoLinuxInputDevice::processEvent())
00099                 return false;
00100         
00101         GizmoEventATIX10 * pATIX10Event = static_cast<GizmoEventATIX10 *>(pEvent);
00102         
00103         switch (pATIX10Event->Type) {
00104         case EV_KEY:
00105                 setKeyState(pATIX10Event->Code, pATIX10Event->Value);
00106                 break;
00107         default:
00108                 // do nothing
00109                 break;
00110         }
00111         
00112         return true;
00113 }

Generated on Wed Nov 7 10:04:16 2007 for gizmod by  doxygen 1.5.3