trekinput.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef TREKINPUT_H
  2. #define TREKINPUT_H
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Trek Input
  6. //
  7. //////////////////////////////////////////////////////////////////////////////
  8. class TrekInputSite : public IObject {
  9. public:
  10. virtual void OnTrekKey(TrekKey tk) = 0;
  11. };
  12. class TrekInput : public IObject {
  13. public:
  14. virtual bool LoadMap(const ZString& str) = 0;
  15. virtual void SetFocus(bool bFocus) = 0;
  16. virtual void PlayFFEffect(ForceEffectID effectID, LONG lDirection = 0) = 0;
  17. virtual float GetAxis(int index) = 0;
  18. virtual bool IsAxisValid(int index) = 0;
  19. virtual bool IsTrekKeyDown(TrekKey trekkey, bool bCheckKeyboard) = 0;
  20. virtual TrekKey TranslateKeyMessage(const KeyState& ks) = 0;
  21. virtual TrekKey HandleKeyMessage(const KeyState& ks) = 0;
  22. virtual void GetButtonTrekKeys(TrekInputSite* psite) = 0;
  23. virtual ZString GetFPSString() = 0;
  24. virtual TRef<IPopup> CreateInputMapPopup(Modeler* pmodeler, IEngineFont* pfont, Number* ptime) = 0;
  25. };
  26. TRef<TrekInput> CreateTrekInput(HINSTANCE hInst, HWND hwnd, InputEngine* pinputEngine, JoystickImage* pjoystickImage);
  27. #define INPUTMAP_FILE "inputmap1"
  28. #define DEFAULTINPUTMAP_FILE "defaultinputmap"
  29. #endif