CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 
00047 SCF_VERSION(iKeyComposer, 0, 0, 1);
00048 
00049 
00050 SCF_VERSION(iKeyboardDriver, 0, 0, 2);
00051 
00055 enum csKeyComposeResult
00056 {
00058   csComposeNoChar = -1,
00060   csComposeNormalChar,
00062   csComposeComposedChar,
00067   csComposeUncomposeable
00068 };
00069 
00073 struct iKeyComposer : public iBase
00074 {
00088   virtual csKeyComposeResult HandleKey (const csKeyEventData& keyEventData,
00089     utf32_char* buf, size_t bufChars, int* resultChars = 0) = 0;
00095   virtual void ResetState () = 0;
00096 };
00097 
00105 struct iKeyboardDriver : public iBase
00106 {
00111   virtual void Reset () = 0;
00112 
00123   virtual void DoKey (utf32_char codeRaw, utf32_char codeCooked, bool iDown,
00124     bool autoRepeat = false, csKeyCharType charType = csKeyCharTypeNormal) = 0;
00125 
00130   virtual bool GetKeyState (utf32_char codeRaw) = 0;
00131 
00135   virtual uint32 GetModifierState (utf32_char codeRaw) = 0;
00136 
00143   virtual csPtr<iKeyComposer> CreateKeyComposer () = 0;
00144 };
00145 
00146 SCF_VERSION(iMouseDriver, 0, 0, 1);
00147 
00155 struct iMouseDriver : public iBase
00156 {
00158   virtual void SetDoubleClickTime (int iTime, size_t iDist) = 0;
00159 
00164   virtual void Reset () = 0;
00165 
00167   virtual int GetLastX () = 0;
00169   virtual int GetLastY () = 0;
00171   virtual bool GetLastButton (int button) = 0;
00172 
00174   virtual void DoButton (int button, bool down, int x, int y) = 0;
00176   virtual void DoMotion (int x, int y) = 0;
00177 };
00178 
00179 SCF_VERSION(iJoystickDriver, 0, 0, 1);
00180 
00188 struct iJoystickDriver : public iBase
00189 {
00194   virtual void Reset () = 0;
00195 
00197   virtual int GetLastX (int number) = 0;
00199   virtual int GetLastY (int number) = 0;
00201   virtual bool GetLastButton (int number, int button) = 0;
00202 
00204   virtual void DoButton (int number, int button, bool down, int x, int y) = 0;
00206   virtual void DoMotion (int number, int x, int y) = 0;
00207 };
00208 
00211 #endif // __CS_IUTIL_STDINPUT_H__

Generated for Crystal Space by doxygen 1.2.18