Input.pkg 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 SetToggleFullscreen(bool enable);
  26. void SetMouseVisible(bool enable);
  27. bool OpenJoystick(unsigned index);
  28. void CloseJoystick(unsigned index);
  29. bool DetectJoysticks();
  30. void SetScreenKeyboardVisible(bool enable);
  31. bool GetKeyDown(int key) const;
  32. bool GetKeyPress(int key) const;
  33. bool GetMouseButtonDown(int button) const;
  34. bool GetMouseButtonPress(int button) const;
  35. bool GetQualifierDown(int qualifier) const;
  36. bool GetQualifierPress(int qualifier) const;
  37. int GetQualifiers() const;
  38. IntVector2 GetMousePosition() const;
  39. const IntVector2& GetMouseMove() const;
  40. int GetMouseMoveX() const;
  41. int GetMouseMoveY() const;
  42. int GetMouseMoveWheel() const;
  43. unsigned GetNumTouches() const;
  44. TouchState* GetTouch(unsigned index) const;
  45. unsigned GetNumJoysticks() const;
  46. const String GetJoystickName(unsigned index) const;
  47. JoystickState* GetJoystick(unsigned index);
  48. bool GetToggleFullscreen() const;
  49. bool GetScreenKeyboardSupport() const;
  50. bool IsScreenKeyboardVisible() const;
  51. bool IsMouseVisible() const;
  52. bool HasFocus();
  53. bool IsMinimized() const;
  54. tolua_readonly tolua_property__get_set int qualifiers;
  55. tolua_readonly tolua_property__get_set IntVector2 mousePosition;
  56. tolua_readonly tolua_property__get_set IntVector2& mouseMove;
  57. tolua_readonly tolua_property__get_set int mouseMoveX;
  58. tolua_readonly tolua_property__get_set int mouseMoveY;
  59. tolua_readonly tolua_property__get_set int mouseMoveWheel;
  60. tolua_readonly tolua_property__get_set unsigned numTouches;
  61. tolua_readonly tolua_property__get_set unsigned numJoysticks;
  62. tolua_readonly tolua_property__get_set bool toggleFullscreen;
  63. tolua_readonly tolua_property__get_set bool screenKeyboardSupport;
  64. tolua_property__is_set bool screenKeyboardVisible;
  65. tolua_property__is_set bool mouseVisible;
  66. tolua_readonly tolua_property__has_set bool focus;
  67. tolua_readonly tolua_property__is_set bool minimized;
  68. };