Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
csinput.h
Go to the documentation of this file.00001 /* 00002 Crystal Space input library 00003 Copyright (C) 1998,2000 by Jorrit Tyberghein 00004 Written by Andrew Zabolotny <bit@eltech.ru> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the Free 00018 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __CS_IUTIL_STDINPUT_H__ 00022 #define __CS_IUTIL_STDINPUT_H__ 00023 00036 #include "csutil/scf.h" 00037 #include "iutil/event.h" 00038 #include "csutil/csunicode.h" 00039 00041 #define CS_MAX_MOUSE_BUTTONS 10 00042 00043 #define CS_MAX_JOYSTICK_COUNT 16 00044 00045 #define CS_MAX_JOYSTICK_BUTTONS 10 00046 00050 enum csKeyComposeResult 00051 { 00053 csComposeNoChar = -1, 00055 csComposeNormalChar, 00057 csComposeComposedChar, 00062 csComposeUncomposeable 00063 }; 00064 00065 SCF_VERSION(iKeyComposer, 0, 0, 1); 00066 00070 struct iKeyComposer : public iBase 00071 { 00086 virtual csKeyComposeResult HandleKey (const csKeyEventData& keyEventData, 00087 utf32_char* buf, size_t bufChars, int* resultChars = 0) = 0; 00093 virtual void ResetState () = 0; 00094 }; 00095 00096 SCF_VERSION(iKeyboardDriver, 0, 0, 2); 00097 00116 struct iKeyboardDriver : public iBase 00117 { 00122 virtual void Reset () = 0; 00123 00134 virtual void DoKey (utf32_char codeRaw, utf32_char codeCooked, bool iDown, 00135 bool autoRepeat = false, csKeyCharType charType = csKeyCharTypeNormal) = 0; 00136 00141 virtual bool GetKeyState (utf32_char codeRaw) = 0; 00142 00146 virtual uint32 GetModifierState (utf32_char codeRaw) = 0; 00147 00154 virtual csPtr<iKeyComposer> CreateKeyComposer () = 0; 00155 00160 virtual csEventError SynthesizeCooked (iEvent *) = 0; 00161 }; 00162 00163 SCF_VERSION(iMouseDriver, 0, 0, 1); 00164 00186 struct iMouseDriver : public iBase 00187 { 00189 virtual void SetDoubleClickTime (int iTime, size_t iDist) = 0; 00190 00195 virtual void Reset () = 0; 00196 00198 virtual int GetLastX () = 0; 00200 virtual int GetLastY () = 0; 00202 virtual bool GetLastButton (int button) = 0; 00203 00208 virtual void DoButton (int button, bool down, int x, int y) = 0; 00210 virtual void DoMotion (int x, int y) = 0; 00211 }; 00212 00213 SCF_VERSION(iJoystickDriver, 0, 0, 1); 00214 00234 struct iJoystickDriver : public iBase 00235 { 00240 virtual void Reset () = 0; 00241 00243 virtual int GetLastX (int number) = 0; 00245 virtual int GetLastY (int number) = 0; 00250 virtual bool GetLastButton (int number, int button) = 0; 00251 00256 virtual void DoButton (int number, int button, bool down, int x, int y) = 0; 00258 virtual void DoMotion (int number, int x, int y) = 0; 00259 }; 00260 00263 #endif // __CS_IUTIL_STDINPUT_H__
Generated for Crystal Space by doxygen 1.3.9.1