iutil/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 2 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 }; 00156 00157 SCF_VERSION(iMouseDriver, 0, 0, 1); 00158 00180 struct iMouseDriver : public iBase 00181 { 00183 virtual void SetDoubleClickTime (int iTime, size_t iDist) = 0; 00184 00189 virtual void Reset () = 0; 00190 00192 virtual int GetLastX () = 0; 00194 virtual int GetLastY () = 0; 00196 virtual bool GetLastButton (int button) = 0; 00197 00202 virtual void DoButton (int button, bool down, int x, int y) = 0; 00204 virtual void DoMotion (int x, int y) = 0; 00205 }; 00206 00207 SCF_VERSION(iJoystickDriver, 0, 0, 1); 00208 00228 struct iJoystickDriver : public iBase 00229 { 00234 virtual void Reset () = 0; 00235 00237 virtual int GetLastX (int number) = 0; 00239 virtual int GetLastY (int number) = 0; 00244 virtual bool GetLastButton (int number, int button) = 0; 00245 00250 virtual void DoButton (int number, int button, bool down, int x, int y) = 0; 00252 virtual void DoMotion (int number, int x, int y) = 0; 00253 }; 00254 00257 #endif // __CS_IUTIL_STDINPUT_H__
Generated for Crystal Space by doxygen 1.2.18