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 _omKeyboardDriver_ 00028 #define _omKeyboardDriver_ 00029 00030 #include <openmaia/omcommon.h> 00031 #include <openmaia/omObject.h> 00032 #include <openmaia/omFunctions.h> 00033 00034 #include <wx/wx.h> 00035 00036 #include <sys/ioctl.h> 00037 #include <sys/types.h> 00038 #include <sys/stat.h> 00039 #include <sys/termios.h> 00040 #include <fcntl.h> 00041 00042 00056 class omKeyboardDriver: public omObject, wxTimer 00057 { 00058 private: 00059 00060 long actionKey, 00061 upKey, 00062 downKey, 00063 leftKey, 00064 rightKey; 00065 bool grabKeys, 00066 actionOnPress; 00067 00068 00069 void *systemDependentData ; 00070 00071 long maiaKeyCode[MAXMAIACODES] ; 00072 int tickTime ; 00073 00074 void Notify() ; // overrides timer notify 00075 void SystemDependentConstructor() ; 00076 void SystemDependentNotify() ; 00077 00078 void SDFlushKey(long, bool * ); 00079 // system dependent keyboard functions 00080 void SDGrabActionKeys() ; 00081 void SDUngrabActionKeys() ; 00082 void SDFlushKeysState(); 00083 void SDDestructor(); 00084 00085 00086 public: 00087 omObject *toInform ; 00088 omObject *executorController; 00089 omKeyboardDriver(omObject *, omObject *, 00090 int, long, long, long, long, long, 00091 bool, bool) ; 00092 ~omKeyboardDriver(); 00093 void SetOnPress(bool) ; // set action on press flag 00094 void SetGrabKeys(bool); // set grab keys flag 00095 void Start() ; // start the event catching 00096 void Stop() ; // stop the event catching 00097 void GrabActionKeys() ; 00098 void UngrabActionKeys() ; 00099 void FlushKeysState(); // flush the keys state 00100 }; 00101 00102 00103 #endif // _omKeyboardDriver_
Copyright © by Luca Clivio |