00001 00002 // This code is part of the MaiaProject free software 00003 // 00004 // Keyboard and Mouse Emulator - Virtual keyboard Engine 00005 // 00006 // Copyright (c) 2002-2003 Luca Clivio <luca.clivio@maiaproject.org> 00007 // Tel. +39-347-2538040 00008 // via B.Croce 2, 20037 Paderno Dugnano (Milano) - Italy 00009 // 00010 // Developers: 00011 // Simone Mangano <simone.mangano@maiaproject.org> 00012 // Andrea Tosato <andrea.tosato@maiaproject.org> 00013 // 00014 // ----------------------------------------------------------------------------- 00015 // This program is free software; This program is free software; 00016 // you can redistribute it and/or modify it under the terms of the 00017 // GNU General Public License as published by the Free Software Foundation; 00018 // either version 2 of the License, or (at your option) any later version. 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU General Public License for more details. 00022 // You should have received a copy of the GNU General Public License 00023 // along with this program; if not, write to the Free Software 00024 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00026 00027 #ifndef _omJoystickDriver_ 00028 #define _omJoystickDriver_ 00029 00030 #include <openmaia/omObject.h> 00031 00032 #include <wx/wx.h> 00033 #include <wx/joystick.h> 00034 00035 00036 00063 class omJoystickDriver: public omObject, wxTimer 00064 { 00065 private: 00066 // run parameters 00067 int tickTime; 00068 int sxThreshold, 00069 dxThreshold, 00070 upThreshold, 00071 downThreshold; 00072 omObject *toInform ; 00073 bool actionOnPress; 00074 00075 // operation variables 00076 wxJoystick *joy ; 00077 bool joystickConnected; 00078 bool isSx, 00079 isDx, 00080 isUp, 00081 isDown, 00082 isButton, 00083 allButtonsEnabled; 00084 int buttonMask; 00085 00086 // methods 00087 void Notify() ; 00088 00089 public: 00090 00091 omJoystickDriver(omObject *, int, int, float, float, float, float, bool); 00092 bool GetError() ; // return error state 00093 void Start() ; // start the event catching 00094 void Stop() ; // stop the event catching 00095 void EnableAllButtons(); // send event on any button pression 00096 void DisableAllButtons(); // send event on button1 pression (default) 00097 00098 }; 00099 00100 00101 #endif // _omJoystickDriver_
Copyright © by Luca Clivio |