BsScriptInput.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include "BsScriptEnginePrerequisites.h"
  3. #include "BsScriptObject.h"
  4. #include "BsInputFwd.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_SCR_BE_EXPORT ScriptInput : public ScriptObject<ScriptInput>
  8. {
  9. public:
  10. SCRIPT_OBJ(BansheeEngineAssemblyName, "BansheeEngine", "Input")
  11. static void startUp();
  12. static void shutDown();
  13. private:
  14. static void onButtonDown(const ButtonEvent& ev);
  15. static void onButtonUp(const ButtonEvent& ev);
  16. static void onCharInput(const TextInputEvent& ev);
  17. static void onPointerMoved(const PointerEvent& ev);
  18. static void onPointerPressed(const PointerEvent& ev);
  19. static void onPointerReleased(const PointerEvent& ev);
  20. static void onPointerDoubleClick(const PointerEvent& ev);
  21. static bool internal_isButtonHeld(ButtonCode code, UINT32 deviceIdx);
  22. static bool internal_isButtonDown(ButtonCode code, UINT32 deviceIdx);
  23. static bool internal_isButtonUp(ButtonCode code, UINT32 deviceIdx);
  24. static float internal_getAxisValue(UINT32 axisType, UINT32 deviceIdx);
  25. typedef void(__stdcall *OnButtonEventThunkDef) (ButtonCode, UINT32, MonoException**);
  26. typedef void(__stdcall *OnCharInputEventThunkDef) (UINT32, MonoException**);
  27. typedef void(__stdcall *OnPointerEventThunkDef) (Vector2I, PointerEventButton, bool, bool, bool, float, MonoException**);
  28. static OnButtonEventThunkDef OnButtonPressedThunk;
  29. static OnButtonEventThunkDef OnButtonReleasedThunk;
  30. static OnCharInputEventThunkDef OnCharInputThunk;
  31. static OnPointerEventThunkDef OnPointerPressedThunk;
  32. static OnPointerEventThunkDef OnPointerReleasedThunk;
  33. static OnPointerEventThunkDef OnPointerMovedThunk;
  34. static OnPointerEventThunkDef OnPointerDoubleClickThunk;
  35. static HEvent OnButtonPressedConn;
  36. static HEvent OnButtonReleasedConn;
  37. static HEvent OnCharInputConn;
  38. static HEvent OnPointerPressedConn;
  39. static HEvent OnPointerReleasedConn;
  40. static HEvent OnPointerMovedConn;
  41. static HEvent OnPointerDoubleClickConn;
  42. ScriptInput(MonoObject* instance);
  43. };
  44. }