| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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
    00043 enum csKeyComposeResult
    00044 {
    00046   csComposeNoChar = -1,
    00048   csComposeNormalChar,
    00050   csComposeComposedChar,
    00055   csComposeUncomposeable
    00056 };
    00057
    00061 struct iKeyComposer : public virtual iBase
    00062 {
    00063   SCF_INTERFACE(iKeyComposer, 2,0,0);
    00078   virtual csKeyComposeResult HandleKey (const csKeyEventData& keyEventData,
    00079     utf32_char* buf, size_t bufChars, int* resultChars = 0) = 0;
    00085   virtual void ResetState () = 0;
    00086 };
    00087
    00088
    00112 struct iKeyboardDriver : public virtual iBase
    00113 {
    00114   SCF_INTERFACE(iKeyboardDriver, 2,0,0);
    00119   virtual void Reset () = 0;
    00120
    00131   virtual void DoKey (utf32_char codeRaw, utf32_char codeCooked, bool iDown,
    00132     bool autoRepeat = false, csKeyCharType charType = csKeyCharTypeNormal) = 0;
    00133
    00138   virtual bool GetKeyState (utf32_char codeRaw) const = 0;
    00139
    00143   virtual uint32 GetModifierState (utf32_char codeRaw) const = 0;
    00144
    00151   virtual csPtr<iKeyComposer> CreateKeyComposer () = 0;
    00152
    00157   virtual csEventError SynthesizeCooked (iEvent *) = 0;
    00158 };
    00159
    00160
    00179 struct iMouseDriver : public virtual iBase
    00180 {
    00181   SCF_INTERFACE(iMouseDriver, 2,0,0);
    00183   virtual void SetDoubleClickTime (int iTime, size_t iDist) = 0;
    00184
    00189   virtual void Reset () = 0;
    00190
    00192   virtual int GetLastX (uint number = 0) const = 0;
    00194   virtual int GetLastY (uint number = 0) const = 0;
    00196   virtual int GetLast (uint n, uint a) const = 0;
    00198   virtual const int32 *GetLast (uint n) const = 0;
    00200   virtual bool GetLastButton (uint number, int button) const = 0;
    00201   virtual bool GetLastButton (int button) const = 0;
    00202
    00207   virtual void DoButton (uint number, int button, bool down,
    00208     const int32 *axes, uint numAxes) = 0;
    00209   virtual void DoButton (int button, bool down, int x, int y) = 0;
    00211   virtual void DoMotion (uint number, const int32 *axes, uint numAxes) = 0;
    00212   virtual void DoMotion (int x, int y) = 0;
    00213 };
    00214
    00215 SCF_VERSION(iJoystickDriver, 0, 0, 1);
    00216
    00233 struct iJoystickDriver : public virtual iBase
    00234 {
    00235   SCF_INTERFACE(iJoystickDriver, 2,0,0);
    00240   virtual void Reset () = 0;
    00241
    00243   CS_DEPRECATED_METHOD virtual int GetLastX (uint number) const = 0;
    00245   CS_DEPRECATED_METHOD virtual int GetLastY (uint number) const = 0;
    00247   virtual const int32 *GetLast (uint number) const = 0;
    00249   virtual int GetLast (uint number, uint axis) const = 0;
    00250
    00255   virtual bool GetLastButton (uint number, int button) const = 0;
    00256
    00261   virtual void DoButton (uint number, int button, bool down,
    00262     const int32 *axes, uint numAxes) = 0;
    00264   virtual void DoMotion (uint number, const int32 *axes, uint nunmAxes) = 0;
    00265 };
    00266
    00269 #endif // __CS_IUTIL_STDINPUT_H__