Input.pkg 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. $#include "Input.h"
  2. struct TouchState
  3. {
  4. int touchID_ @ touchID;
  5. IntVector2 position_ @ position;
  6. IntVector2 lastPosition_ @ lastPosition;
  7. IntVector2 delta_ @ delta;
  8. float pressure_ @ pressure;
  9. };
  10. struct JoystickState
  11. {
  12. unsigned GetNumButtons() const;
  13. unsigned GetNumAxes() const;
  14. unsigned GetNumHats() const;
  15. bool GetButtonDown(unsigned index) const;
  16. bool GetButtonPress(unsigned index) const;
  17. float GetAxisPosition(unsigned index) const;
  18. int GetHatPosition(unsigned index) const;
  19. tolua_readonly tolua_property__get_set unsigned numButtons;
  20. tolua_readonly tolua_property__get_set unsigned numAxes;
  21. tolua_readonly tolua_property__get_set unsigned numHats;
  22. };
  23. class Input : public Object
  24. {
  25. void SetMouseVisible(bool enable);
  26. bool OpenJoystick(unsigned index);
  27. void CloseJoystick(unsigned index);
  28. bool DetectJoysticks();
  29. bool GetKeyDown(int key) const;
  30. bool GetKeyPress(int key) const;
  31. bool GetMouseButtonDown(int button) const;
  32. bool GetMouseButtonPress(int button) const;
  33. bool GetQualifierDown(int qualifier) const;
  34. bool GetQualifierPress(int qualifier) const;
  35. int GetQualifiers() const;
  36. IntVector2 GetMousePosition() const;
  37. const IntVector2& GetMouseMove() const;
  38. int GetMouseMoveX() const;
  39. int GetMouseMoveY() const;
  40. int GetMouseMoveWheel() const;
  41. unsigned GetNumTouches() const;
  42. TouchState* GetTouch(unsigned index) const;
  43. unsigned GetNumJoysticks() const;
  44. const String& GetJoystickName(unsigned index) const;
  45. JoystickState* GetJoystick(unsigned index);
  46. bool GetToggleFullscreen() const;
  47. bool IsMouseVisible() const;
  48. bool HasFocus();
  49. bool IsMinimized() const;
  50. tolua_readonly tolua_property__get_set int qualifiers;
  51. tolua_readonly tolua_property__get_set IntVector2 mousePosition;
  52. tolua_readonly tolua_property__get_set IntVector2& mouseMove;
  53. tolua_readonly tolua_property__get_set int mouseMoveX;
  54. tolua_readonly tolua_property__get_set int mouseMoveY;
  55. tolua_readonly tolua_property__get_set int mouseMoveWheel;
  56. tolua_readonly tolua_property__get_set unsigned numTouches;
  57. tolua_readonly tolua_property__get_set unsigned numJoysticks;
  58. tolua_readonly tolua_property__get_set bool toggleFullscreen;
  59. tolua_property__is_set bool mouseVisible;
  60. tolua_readonly tolua_property__has_set bool focus;
  61. tolua_readonly tolua_property__is_set bool minimized;
  62. };