ImitateInput.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright aXiuShen. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #ifdef WEBVIEW_CUSTOMIZED_CORE
  5. #include "CefImitateInput.h"
  6. #endif
  7. #include "Layout/Visibility.h"
  8. #include "Input/Reply.h"
  9. #include "Widgets/DeclarativeSyntaxSupport.h"
  10. #include "Widgets/SCompoundWidget.h"
  11. #include "Framework/SlateDelegates.h"
  12. #include "ImitateInput.generated.h"
  13. UENUM(BlueprintType, Category = "Web View", meta = (DisplayName = "Imitate Input Mouse"))
  14. enum class WebView_ImitateInput_Mouse : uint8
  15. {
  16. WebView_ImitateInput_Mouse_Down = 0 UMETA(DisplayName = "MouseDown"),
  17. WebView_ImitateInput_Mouse_Up = 1 UMETA(DisplayName = "MouseUp"),
  18. WebView_ImitateInput_Mouse_Move = 2 UMETA(DisplayName = "MouseMove"),
  19. };
  20. UENUM(BlueprintType, Category = "Web View", meta = (DisplayName = "Imitate Input Key"))
  21. enum class WebView_ImitateInput_Key : uint8
  22. {
  23. WebView_ImitateInput_Key_Down = 0 UMETA(DisplayName = "KeyDown"),
  24. WebView_ImitateInput_Key_Up = 1 UMETA(DisplayName = "KeyUp"),
  25. WebView_ImitateInput_Key_Char = 2 UMETA(DisplayName = "KeyChar"),
  26. };
  27. USTRUCT(BlueprintType)
  28. struct WEBVIEW_API FImitateInput //public UObject
  29. {
  30. public:
  31. GENERATED_USTRUCT_BODY()
  32. /*
  33. * Show web content when Imitate Input
  34. */
  35. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Web View")
  36. bool Show = true;
  37. /*
  38. * Time interval between events .ms , If the interval time is insufficient, call the AddDelay node to increase
  39. */
  40. UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (UIMin = 10, UIMax = 10000), Category = "Web View")
  41. int interval = 20;
  42. /*
  43. * Simulate event screen resolution. After setting, it can adapt to any resolution.
  44. * Please keep the size and webpixel values the same in the editor
  45. */
  46. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Web View")
  47. FIntPoint Size= FIntPoint(0, 0);
  48. /*
  49. {"type":"delay","ms":3000}
  50. {"type":"input","text":"content"}
  51. {"type":"key_down","code":0,"character":0,"modify":0}
  52. {"type":"key_char","code":0,"character":0,"modify":0}
  53. {"type":"key_up","code":0,"character":0,"modify":0}
  54. {"type":"mouse_down","pos":{"x":128,"y":256}}
  55. {"type":"mouse_move","pos":{"x":128,"y":256}}
  56. {"type":"mouse_up","pos":{"x":128,"y":256}}
  57. */
  58. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Web View")
  59. TArray<FString> Event;
  60. };
  61. UENUM(BlueprintType, Category = "Web View")
  62. enum class WebView_Keyboard_Mode: uint8
  63. {
  64. WebView_Keyboard_Mode_Scenes = 1 UMETA(DisplayName = "Scenes"),
  65. WebView_Keyboard_Mode_Blend = 0 UMETA(DisplayName = "Blend"),
  66. WebView_Keyboard_Mode_Both = 2 UMETA(DisplayName = "Both"),
  67. };
  68. #ifdef WEBVIEW_CUSTOMIZED_CORE
  69. namespace webview {
  70. cef::WebView_Keyboard_Mode toInner(WebView_Keyboard_Mode);
  71. cef::FImitateInput toInner(FImitateInput);
  72. cef::WebView_ImitateInput_Key toInner(WebView_ImitateInput_Key);
  73. cef::WebView_ImitateInput_Mouse toInner(WebView_ImitateInput_Mouse);
  74. }
  75. #endif