2
0

BsScriptInput.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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) (MonoObject*, PointerEventButton,
  28. bool, bool, bool, float, MonoException**);
  29. static OnButtonEventThunkDef OnButtonPressedThunk;
  30. static OnButtonEventThunkDef OnButtonReleasedThunk;
  31. static OnCharInputEventThunkDef OnCharInputThunk;
  32. static OnPointerEventThunkDef OnPointerPressedThunk;
  33. static OnPointerEventThunkDef OnPointerReleasedThunk;
  34. static OnPointerEventThunkDef OnPointerMovedThunk;
  35. static OnPointerEventThunkDef OnPointerDoubleClickThunk;
  36. static HEvent OnButtonPressedConn;
  37. static HEvent OnButtonReleasedConn;
  38. static HEvent OnCharInputConn;
  39. static HEvent OnPointerPressedConn;
  40. static HEvent OnPointerReleasedConn;
  41. static HEvent OnPointerMovedConn;
  42. static HEvent OnPointerDoubleClickConn;
  43. ScriptInput(MonoObject* instance);
  44. };
  45. }